| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/search_provider.h" | 5 #include "components/omnibox/browser/search_provider.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 } | 542 } |
| 543 } | 543 } |
| 544 | 544 |
| 545 void SearchProviderTest::ResetFieldTrialList() { | 545 void SearchProviderTest::ResetFieldTrialList() { |
| 546 // Destroy the existing FieldTrialList before creating a new one to avoid | 546 // Destroy the existing FieldTrialList before creating a new one to avoid |
| 547 // a DCHECK. | 547 // a DCHECK. |
| 548 field_trial_list_.reset(); | 548 field_trial_list_.reset(); |
| 549 field_trial_list_.reset(new base::FieldTrialList( | 549 field_trial_list_.reset(new base::FieldTrialList( |
| 550 new metrics::SHA1EntropyProvider("foo"))); | 550 new metrics::SHA1EntropyProvider("foo"))); |
| 551 variations::testing::ClearAllVariationParams(); | 551 variations::testing::ClearAllVariationParams(); |
| 552 base::FieldTrial* trial = base::FieldTrialList::CreateFieldTrial( | |
| 553 "AutocompleteDynamicTrial_0", "DefaultGroup"); | |
| 554 trial->group(); | |
| 555 } | 552 } |
| 553 |
| 556 base::FieldTrial* SearchProviderTest::CreateFieldTrial( | 554 base::FieldTrial* SearchProviderTest::CreateFieldTrial( |
| 557 const char* field_trial_rule, | 555 const char* field_trial_rule, |
| 558 bool enabled) { | 556 bool enabled) { |
| 559 std::map<std::string, std::string> params; | 557 std::map<std::string, std::string> params; |
| 560 params[std::string(field_trial_rule)] = enabled ? | 558 params[std::string(field_trial_rule)] = enabled ? |
| 561 "true" : "false"; | 559 "true" : "false"; |
| 562 variations::AssociateVariationParams( | 560 variations::AssociateVariationParams( |
| 563 OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A", params); | 561 OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A", params); |
| 564 return base::FieldTrialList::CreateFieldTrial( | 562 return base::FieldTrialList::CreateFieldTrial( |
| 565 OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A"); | 563 OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A"); |
| (...skipping 3030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3596 } | 3594 } |
| 3597 | 3595 |
| 3598 TEST_F(SearchProviderTest, DoesNotProvideOnFocus) { | 3596 TEST_F(SearchProviderTest, DoesNotProvideOnFocus) { |
| 3599 AutocompleteInput input( | 3597 AutocompleteInput input( |
| 3600 base::ASCIIToUTF16("f"), base::string16::npos, std::string(), GURL(), | 3598 base::ASCIIToUTF16("f"), base::string16::npos, std::string(), GURL(), |
| 3601 metrics::OmniboxEventProto::INVALID_SPEC, false, true, true, true, true, | 3599 metrics::OmniboxEventProto::INVALID_SPEC, false, true, true, true, true, |
| 3602 ChromeAutocompleteSchemeClassifier(&profile_)); | 3600 ChromeAutocompleteSchemeClassifier(&profile_)); |
| 3603 provider_->Start(input, false); | 3601 provider_->Start(input, false); |
| 3604 EXPECT_TRUE(provider_->matches().empty()); | 3602 EXPECT_TRUE(provider_->matches().empty()); |
| 3605 } | 3603 } |
| OLD | NEW |