OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/autocomplete_result.h" | 5 #include "chrome/browser/autocomplete/autocomplete_result.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 field_trial_list_.reset(new base::FieldTrialList( | 89 field_trial_list_.reset(new base::FieldTrialList( |
90 new metrics::SHA1EntropyProvider("foo"))); | 90 new metrics::SHA1EntropyProvider("foo"))); |
91 chrome_variations::testing::ClearAllVariationParams(); | 91 chrome_variations::testing::ClearAllVariationParams(); |
92 } | 92 } |
93 | 93 |
94 virtual void SetUp() OVERRIDE { | 94 virtual void SetUp() OVERRIDE { |
95 #if defined(OS_ANDROID) | 95 #if defined(OS_ANDROID) |
96 TemplateURLPrepopulateData::InitCountryCode( | 96 TemplateURLPrepopulateData::InitCountryCode( |
97 std::string() /* unknown country code */); | 97 std::string() /* unknown country code */); |
98 #endif | 98 #endif |
99 test_util_.SetUp(); | |
100 test_util_.VerifyLoad(); | 99 test_util_.VerifyLoad(); |
101 } | 100 } |
102 | 101 |
103 virtual void TearDown() OVERRIDE { | |
104 test_util_.TearDown(); | |
105 } | |
106 | |
107 // Configures |match| from |data|. | 102 // Configures |match| from |data|. |
108 static void PopulateAutocompleteMatch(const TestData& data, | 103 static void PopulateAutocompleteMatch(const TestData& data, |
109 AutocompleteMatch* match); | 104 AutocompleteMatch* match); |
110 | 105 |
111 // Adds |count| AutocompleteMatches to |matches|. | 106 // Adds |count| AutocompleteMatches to |matches|. |
112 static void PopulateAutocompleteMatches(const TestData* data, | 107 static void PopulateAutocompleteMatches(const TestData* data, |
113 size_t count, | 108 size_t count, |
114 ACMatches* matches); | 109 ACMatches* matches); |
115 | 110 |
116 // Asserts that |result| has |expected_count| matches matching |expected|. | 111 // Asserts that |result| has |expected_count| matches matching |expected|. |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 result.Reset(); | 849 result.Reset(); |
855 matches.clear(); | 850 matches.clear(); |
856 | 851 |
857 // Case 5: Multiple verbatim matches found in AutocompleteResult. | 852 // Case 5: Multiple verbatim matches found in AutocompleteResult. |
858 PopulateAutocompleteMatchesFromTestData(kVerbatimMatches, | 853 PopulateAutocompleteMatchesFromTestData(kVerbatimMatches, |
859 arraysize(kVerbatimMatches), | 854 arraysize(kVerbatimMatches), |
860 &matches); | 855 &matches); |
861 result.AppendMatches(matches); | 856 result.AppendMatches(matches); |
862 EXPECT_FALSE(result.ShouldHideTopMatch()); | 857 EXPECT_FALSE(result.ShouldHideTopMatch()); |
863 } | 858 } |
OLD | NEW |