OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/omnibox/browser/omnibox_field_trial.h" | 5 #include "components/omnibox/browser/omnibox_field_trial.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 params["rule4:4:0"] = "rule4-4-0-value"; // OTHER | 311 params["rule4:4:0"] = "rule4-4-0-value"; // OTHER |
312 // Add a malformed rule to make sure it doesn't screw things up. | 312 // Add a malformed rule to make sure it doesn't screw things up. |
313 params["unrecognized"] = "unrecognized-value"; | 313 params["unrecognized"] = "unrecognized-value"; |
314 ASSERT_TRUE(variations::AssociateVariationParams( | 314 ASSERT_TRUE(variations::AssociateVariationParams( |
315 OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A", params)); | 315 OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A", params)); |
316 } | 316 } |
317 | 317 |
318 base::FieldTrialList::CreateFieldTrial( | 318 base::FieldTrialList::CreateFieldTrial( |
319 OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A"); | 319 OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A"); |
320 | 320 |
321 if (chrome::IsInstantExtendedAPIEnabled()) { | 321 if (search::IsInstantExtendedAPIEnabled()) { |
322 // Tests with Instant Extended enabled. | 322 // Tests with Instant Extended enabled. |
323 // Tests for rule 1. | 323 // Tests for rule 1. |
324 ExpectRuleValue("rule1-4-1-value", | 324 ExpectRuleValue("rule1-4-1-value", |
325 "rule1", OmniboxEventProto::OTHER); // exact match | 325 "rule1", OmniboxEventProto::OTHER); // exact match |
326 ExpectRuleValue("rule1-*-1-value", | 326 ExpectRuleValue("rule1-*-1-value", |
327 "rule1", OmniboxEventProto::BLANK); // partial fallback | 327 "rule1", OmniboxEventProto::BLANK); // partial fallback |
328 ExpectRuleValue("rule1-*-1-value", | 328 ExpectRuleValue("rule1-*-1-value", |
329 "rule1", | 329 "rule1", |
330 OmniboxEventProto::NTP); // partial fallback | 330 OmniboxEventProto::NTP); // partial fallback |
331 | 331 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 NULL, NULL, false, | 491 NULL, NULL, false, |
492 OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs); | 492 OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs); |
493 | 493 |
494 // Valid params. | 494 // Valid params. |
495 VerifySuggestPollingStrategy("true", "50", true, 50); | 495 VerifySuggestPollingStrategy("true", "50", true, 50); |
496 VerifySuggestPollingStrategy(NULL, "35", false, 35); | 496 VerifySuggestPollingStrategy(NULL, "35", false, 35); |
497 VerifySuggestPollingStrategy( | 497 VerifySuggestPollingStrategy( |
498 "true", NULL, true, | 498 "true", NULL, true, |
499 OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs); | 499 OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs); |
500 } | 500 } |
OLD | NEW |