| 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 params["rule4:4:0"] = "rule4-4-0-value"; // OTHER | 295 params["rule4:4:0"] = "rule4-4-0-value"; // OTHER |
| 296 // Add a malformed rule to make sure it doesn't screw things up. | 296 // Add a malformed rule to make sure it doesn't screw things up. |
| 297 params["unrecognized"] = "unrecognized-value"; | 297 params["unrecognized"] = "unrecognized-value"; |
| 298 ASSERT_TRUE(variations::AssociateVariationParams( | 298 ASSERT_TRUE(variations::AssociateVariationParams( |
| 299 OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A", params)); | 299 OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A", params)); |
| 300 } | 300 } |
| 301 | 301 |
| 302 base::FieldTrialList::CreateFieldTrial( | 302 base::FieldTrialList::CreateFieldTrial( |
| 303 OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A"); | 303 OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A"); |
| 304 | 304 |
| 305 if (chrome::IsInstantExtendedAPIEnabled()) { | 305 if (search::IsInstantExtendedAPIEnabled()) { |
| 306 // Tests with Instant Extended enabled. | 306 // Tests with Instant Extended enabled. |
| 307 // Tests for rule 1. | 307 // Tests for rule 1. |
| 308 ExpectRuleValue("rule1-4-1-value", | 308 ExpectRuleValue("rule1-4-1-value", |
| 309 "rule1", OmniboxEventProto::OTHER); // exact match | 309 "rule1", OmniboxEventProto::OTHER); // exact match |
| 310 ExpectRuleValue("rule1-*-1-value", | 310 ExpectRuleValue("rule1-*-1-value", |
| 311 "rule1", OmniboxEventProto::BLANK); // partial fallback | 311 "rule1", OmniboxEventProto::BLANK); // partial fallback |
| 312 ExpectRuleValue("rule1-*-1-value", | 312 ExpectRuleValue("rule1-*-1-value", |
| 313 "rule1", | 313 "rule1", |
| 314 OmniboxEventProto::NTP); // partial fallback | 314 OmniboxEventProto::NTP); // partial fallback |
| 315 | 315 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 NULL, NULL, false, | 475 NULL, NULL, false, |
| 476 OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs); | 476 OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs); |
| 477 | 477 |
| 478 // Valid params. | 478 // Valid params. |
| 479 VerifySuggestPollingStrategy("true", "50", true, 50); | 479 VerifySuggestPollingStrategy("true", "50", true, 50); |
| 480 VerifySuggestPollingStrategy(NULL, "35", false, 35); | 480 VerifySuggestPollingStrategy(NULL, "35", false, 35); |
| 481 VerifySuggestPollingStrategy( | 481 VerifySuggestPollingStrategy( |
| 482 "true", NULL, true, | 482 "true", NULL, true, |
| 483 OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs); | 483 OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs); |
| 484 } | 484 } |
| OLD | NEW |