Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: components/omnibox/browser/omnibox_field_trial_unittest.cc

Issue 1286093006: Launch HQP & HUP score changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing Barts comments Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/omnibox/browser/omnibox_field_trial_unittest.cc
diff --git a/components/omnibox/browser/omnibox_field_trial_unittest.cc b/components/omnibox/browser/omnibox_field_trial_unittest.cc
index a7fc14827a37e0f380c492e034bca1f34aafb4a8..e1fc37ed03a2a6588fb2c75d9ff32d396326423a 100644
--- a/components/omnibox/browser/omnibox_field_trial_unittest.cc
+++ b/components/omnibox/browser/omnibox_field_trial_unittest.cc
@@ -446,6 +446,31 @@ TEST_F(OmniboxFieldTrialTest, HUPNewScoringFieldTrial) {
scoring_params.visited_count_buckets.buckets()[1]);
}
+TEST_F(OmniboxFieldTrialTest, HUPNewScoringFieldTrialWithDecayFactor) {
+ {
+ std::map<std::string, std::string> params;
+ params[std::string(OmniboxFieldTrial::kHUPNewScoringEnabledParam)] = "1";
Peter Kasting 2015/08/27 00:50:45 Do the std::string() calls here need to be explici
Ashok vardhan 2015/08/27 19:09:27 I think so, to convert const char to string. Follo
+ params[std::string(
+ OmniboxFieldTrial::kHUPNewScoringTypedCountHalfLifeTimeParam)] = "10";
+ params[std::string(
+ OmniboxFieldTrial::kHUPNewScoringTypedCountUseDecayFactorParam)] = "1";
+ params[std::string(
+ OmniboxFieldTrial::kHUPNewScoringTypedCountScoreBucketsParam)] =
+ "0.1:100,0.5:500,1.0:1000";
+ ASSERT_TRUE(variations::AssociateVariationParams(
+ OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A", params));
+ }
+ base::FieldTrialList::CreateFieldTrial(
+ OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A");
+
+ HUPScoringParams scoring_params;
+ OmniboxFieldTrial::GetExperimentalHUPScoringParams(&scoring_params);
+ EXPECT_TRUE(scoring_params.experimental_scoring_enabled);
+ EXPECT_EQ(10, scoring_params.typed_count_buckets.half_life_days());
+ ASSERT_EQ(3u, scoring_params.typed_count_buckets.buckets().size());
+ ASSERT_EQ(true, scoring_params.typed_count_buckets.use_decay_factor());
+}
+
TEST_F(OmniboxFieldTrialTest, HalfLifeTimeDecay) {
HUPScoringParams::ScoreBuckets buckets;

Powered by Google App Engine
This is Rietveld 408576698