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 "chrome/browser/autocomplete/search_provider.h" | 5 #include "chrome/browser/autocomplete/search_provider.h" |
6 | 6 |
7 #include "base/metrics/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 }; | 161 }; |
162 | 162 |
163 // static | 163 // static |
164 base::FieldTrialList* SearchProviderTest::field_trial_list_ = NULL; | 164 base::FieldTrialList* SearchProviderTest::field_trial_list_ = NULL; |
165 | 165 |
166 // static | 166 // static |
167 void SearchProviderTest::SetUpTestCase() { | 167 void SearchProviderTest::SetUpTestCase() { |
168 // Set up Suggest experiments. | 168 // Set up Suggest experiments. |
169 field_trial_list_ = new base::FieldTrialList( | 169 field_trial_list_ = new base::FieldTrialList( |
170 new metrics::SHA1EntropyProvider("foo")); | 170 new metrics::SHA1EntropyProvider("foo")); |
171 OmniboxFieldTrial::ActivateStaticTrials(); | 171 base::FieldTrial* trial = base::FieldTrialList::CreateFieldTrial( |
| 172 "AutocompleteDynamicTrial_0", "DefaultGroup"); |
| 173 trial->group(); |
172 } | 174 } |
173 | 175 |
174 // static | 176 // static |
175 void SearchProviderTest::TearDownTestCase() { | 177 void SearchProviderTest::TearDownTestCase() { |
176 // Make sure the global instance of FieldTrialList is gone. | 178 // Make sure the global instance of FieldTrialList is gone. |
177 delete field_trial_list_; | 179 delete field_trial_list_; |
178 } | 180 } |
179 | 181 |
180 void SearchProviderTest::SetUp() { | 182 void SearchProviderTest::SetUp() { |
181 // Make sure that fetchers are automatically ungregistered upon destruction. | 183 // Make sure that fetchers are automatically ungregistered upon destruction. |
(...skipping 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1963 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL, | 1965 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL, |
1964 match.contents_class[0].style); | 1966 match.contents_class[0].style); |
1965 EXPECT_EQ(4U, match.contents_class[1].offset); | 1967 EXPECT_EQ(4U, match.contents_class[1].offset); |
1966 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL | | 1968 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL | |
1967 AutocompleteMatch::ACMatchClassification::MATCH, | 1969 AutocompleteMatch::ACMatchClassification::MATCH, |
1968 match.contents_class[1].style); | 1970 match.contents_class[1].style); |
1969 EXPECT_EQ(5U, match.contents_class[2].offset); | 1971 EXPECT_EQ(5U, match.contents_class[2].offset); |
1970 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL, | 1972 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL, |
1971 match.contents_class[2].style); | 1973 match.contents_class[2].style); |
1972 } | 1974 } |
OLD | NEW |