Add documentation regarding field trial test config for in-product help
The //components/feature_engagement component is fully configured
through Chrome Variations, so it is required to also set up the
expected launch configuration in the field trial testing configuration.
This is the case for all Chrome Variations experiments, but since the
rest of the documentation for feature engagement is very specific, it
is easy to forget this part while following the guide.
This CL therefore adds it to the required steps and links to the
relevant configuration and adds a sample configuration so developers
can get a feel for what they are supposed to do.
BUG=None
Change-Id: I7b50683d803f2d1d646a2632b08dd1e8050408e4
Reviewed-on: https://chromium-review.googlesource.com/707306
Reviewed-by: Theresa <twellington@chromium.org>
Commit-Queue: Tommy Nyquist <nyquist@chromium.org>
Cr-Commit-Position: refs/heads/master@{#507475}
diff --git a/components/feature_engagement/README.md b/components/feature_engagement/README.md
index 51a4a2b..8a9f117c 100644
--- a/components/feature_engagement/README.md
+++ b/components/feature_engagement/README.md
@@ -102,6 +102,7 @@
by notifying about events, and checking whether In-Product Help should be
displayed.
* [Configure UMA](#Configuring-UMA).
+* [Add a local field trial testing configuration](#Adding-a-local-field-trial-testing-configuration).
### Declaring your feature
@@ -237,6 +238,43 @@
* `<action name="InProductHelp.ShouldTriggerHelpUIResult.NotTriggered.IPH_MyFunFeature">`
* `<action name="InProductHelp.ShouldTriggerHelpUIResult.Triggered.IPH_MyFunFeature">`
+### Adding a local field trial testing configuration
+
+For each in-product help feature, it is required to also configure the expected
+launch configuration as the main testing configuration. See
+[Field Trial Testing Configuration][field-trial-testing-configuration] for
+details.
+
+Basically this requires you to add a new section to
+`//testing/variations/fieldtrial_testing_config.json` for your feature. The
+format is described in the documentation linked above, but it will probably
+look something like this:
+
+```javascript
+{
+ "MyFunFeatureStudy": [
+ {
+ "platforms": ["android"],
+ "experiments": [
+ {
+ "name": "MyFunFeatureLaunchConfig",
+ "params": {
+ "availability": ">=30",
+ "session_rate": "<1",
+ "event_used": "name:fun_event_happened;comparator:any;window:360;storage:360",
+ "event_trigger": "name:fun_feature_iph_triggered;comparator:any;window:360;storage:360",
+ "event_1": "name:related_fun_thing_happened;comparator:>=1;window:360;storage:360"
+ },
+ "enable_features": ["IPH_MyFunFeature"],
+ "disable_features": []
+ }
+ ]
+ }
+ ],
+ ...
+}
+```
+
## Demo mode
The feature_engagement::Tracker supports a special demo mode, which enables a
@@ -519,3 +557,5 @@
When adding new test suites, also remember to add the suite to the filter file:
`//components/feature_engagement/components_unittests.filter`.
+
+[field-trial-testing-configuration]: https://chromium.googlesource.com/chromium/src/+/master/testing/variations/README.md