diff options
author | dcblack@chromium.org <dcblack@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-29 04:39:48 +0000 |
---|---|---|
committer | dcblack@chromium.org <dcblack@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-29 04:39:48 +0000 |
commit | 4f91d3024b65034841cd59a1a8f6975220e198c0 (patch) | |
tree | da9ef6ea9c199f224447b23a19e2e77a2fe080b1 /chrome/browser/instant | |
parent | fc03e5fe8353ae41faaf7f4f206f599445107fbc (diff) | |
download | chromium_src-4f91d3024b65034841cd59a1a8f6975220e198c0.zip chromium_src-4f91d3024b65034841cd59a1a8f6975220e198c0.tar.gz chromium_src-4f91d3024b65034841cd59a1a8f6975220e198c0.tar.bz2 |
Create a new Dummy Instant field trial to test the system end-to-end, where one end is a Search engineer.
BUG=
Review URL: https://chromiumcodereview.appspot.com/10825404
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153857 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/instant')
-rw-r--r-- | chrome/browser/instant/instant_field_trials.cc | 46 | ||||
-rw-r--r-- | chrome/browser/instant/instant_field_trials.h | 15 |
2 files changed, 61 insertions, 0 deletions
diff --git a/chrome/browser/instant/instant_field_trials.cc b/chrome/browser/instant/instant_field_trials.cc new file mode 100644 index 0000000..8560eb0 --- /dev/null +++ b/chrome/browser/instant/instant_field_trials.cc @@ -0,0 +1,46 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/instant/instant_field_trials.h" + +#include "base/metrics/field_trial.h" +#include "chrome/common/metrics/variations/variation_ids.h" +#include "chrome/common/metrics/variations/variations_util.h" + +namespace instant { + +void SetupInstantFieldTrials() { + const base::FieldTrial::Probability num_buckets = 1000; + // Default to 5%. This number may be overridden by the Variations server. + const base::FieldTrial::Probability group_probability = 50; + const std::string trial_name = "InstantDummy"; + const std::string default_group_name = "DefaultGroup"; + const std::string control_group_name = "Control"; + const std::string experiment_one_group_name = "Experiment1"; + const std::string experiment_two_group_name = "Experiment2"; + scoped_refptr<base::FieldTrial> trial( + base::FieldTrialList::FactoryGetFieldTrial( + trial_name, num_buckets, default_group_name, + 2013, 6, 30, NULL)); + + // Create field trial groups. + trial->AppendGroup(control_group_name, group_probability); + trial->AppendGroup(experiment_one_group_name, group_probability); + trial->AppendGroup(experiment_two_group_name, group_probability); + + // Setup Google Variation IDs for each group in the field trial so Google + // servers are aware of the variants. + chrome_variations::AssociateGoogleVariationID(trial_name, default_group_name, + chrome_variations::kDummyInstantIDDefault); + chrome_variations::AssociateGoogleVariationID(trial_name, control_group_name, + chrome_variations::kDummyInstantIDControl); + chrome_variations::AssociateGoogleVariationID(trial_name, + experiment_one_group_name, + chrome_variations::kDummyInstantIDExperimentOne); + chrome_variations::AssociateGoogleVariationID(trial_name, + experiment_two_group_name, + chrome_variations::kDummyInstantIDExperimentTwo); +} + +} // namespace instant diff --git a/chrome/browser/instant/instant_field_trials.h b/chrome/browser/instant/instant_field_trials.h new file mode 100644 index 0000000..7c52dc8 --- /dev/null +++ b/chrome/browser/instant/instant_field_trials.h @@ -0,0 +1,15 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_INSTANT_INSTANT_FIELD_TRIALS_H_ +#define CHROME_BROWSER_INSTANT_INSTANT_FIELD_TRIALS_H_ + +namespace instant { + +// Opt the user into any appropriate Instant field trials. +void SetupInstantFieldTrials(); + +} // namespace instant + +#endif // CHROME_BROWSER_INSTANT_INSTANT_FIELD_TRIALS_H_ |