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/history_url_provider.h" | 5 #include "chrome/browser/autocomplete/history_url_provider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 141 } |
142 | 142 |
143 virtual ~HistoryURLProviderTest() { | 143 virtual ~HistoryURLProviderTest() { |
144 HistoryQuickProvider::set_disabled(false); | 144 HistoryQuickProvider::set_disabled(false); |
145 } | 145 } |
146 | 146 |
147 // AutocompleteProviderListener: | 147 // AutocompleteProviderListener: |
148 virtual void OnProviderUpdate(bool updated_matches) OVERRIDE; | 148 virtual void OnProviderUpdate(bool updated_matches) OVERRIDE; |
149 | 149 |
150 protected: | 150 protected: |
151 static ProfileKeyedService* CreateTemplateURLService(Profile* profile) { | 151 static ProfileKeyedService* CreateTemplateURLService( |
152 return new TemplateURLService(profile); | 152 content::BrowserContext* profile) { |
| 153 return new TemplateURLService(static_cast<Profile*>(profile)); |
153 } | 154 } |
154 | 155 |
155 // testing::Test | 156 // testing::Test |
156 virtual void SetUp() { | 157 virtual void SetUp() { |
157 SetUpImpl(false); | 158 SetUpImpl(false); |
158 } | 159 } |
159 virtual void TearDown(); | 160 virtual void TearDown(); |
160 | 161 |
161 // Does the real setup. | 162 // Does the real setup. |
162 void SetUpImpl(bool no_db); | 163 void SetUpImpl(bool no_db); |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 RunTest(ASCIIToUTF16("foobar"), string16(), true, | 785 RunTest(ASCIIToUTF16("foobar"), string16(), true, |
785 expected_when_searching_query, arraysize(expected_when_searching_query)); | 786 expected_when_searching_query, arraysize(expected_when_searching_query)); |
786 | 787 |
787 // We should not see search URLs when typing the search engine name. | 788 // We should not see search URLs when typing the search engine name. |
788 const std::string expected_when_searching_site[] = { | 789 const std::string expected_when_searching_site[] = { |
789 test_cases[0].url | 790 test_cases[0].url |
790 }; | 791 }; |
791 RunTest(ASCIIToUTF16("testsearch"), string16(), true, | 792 RunTest(ASCIIToUTF16("testsearch"), string16(), true, |
792 expected_when_searching_site, arraysize(expected_when_searching_site)); | 793 expected_when_searching_site, arraysize(expected_when_searching_site)); |
793 } | 794 } |
OLD | NEW |