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_contents_provider.h" | 5 #include "chrome/browser/autocomplete/history_contents_provider.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 | 62 |
63 const ACMatches& matches() const { return provider_->matches(); } | 63 const ACMatches& matches() const { return provider_->matches(); } |
64 TestingProfile* profile() const { return profile_.get(); } | 64 TestingProfile* profile() const { return profile_.get(); } |
65 HistoryContentsProvider* provider() const { return provider_.get(); } | 65 HistoryContentsProvider* provider() const { return provider_.get(); } |
66 | 66 |
67 protected: | 67 protected: |
68 virtual bool BodyOnly() { return false; } | 68 virtual bool BodyOnly() { return false; } |
69 | 69 |
70 private: | 70 private: |
71 static ProfileKeyedService* CreateTemplateURLService(Profile* profile) { | 71 static ProfileKeyedService* CreateTemplateURLService( |
72 return new TemplateURLService(profile); | 72 content::BrowserContext* profile) { |
| 73 return new TemplateURLService(static_cast<Profile*>(profile)); |
73 } | 74 } |
74 | 75 |
75 // testing::Test | 76 // testing::Test |
76 virtual void SetUp() { | 77 virtual void SetUp() { |
77 profile_.reset(new TestingProfile()); | 78 profile_.reset(new TestingProfile()); |
78 profile_->CreateHistoryService(false, false); | 79 profile_->CreateHistoryService(false, false); |
79 | 80 |
80 HistoryService* history_service = | 81 HistoryService* history_service = |
81 HistoryServiceFactory::GetForProfile(profile_.get(), | 82 HistoryServiceFactory::GetForProfile(profile_.get(), |
82 Profile::EXPLICIT_ACCESS); | 83 Profile::EXPLICIT_ACCESS); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 281 |
281 // Run a query that is found on a search result page and on the main page | 282 // Run a query that is found on a search result page and on the main page |
282 // of the default search engine. The result should be the main page, the | 283 // of the default search engine. The result should be the main page, the |
283 // SRP should be culled. | 284 // SRP should be culled. |
284 const ACMatches& m = matches(); | 285 const ACMatches& m = matches(); |
285 ASSERT_EQ(1U, m.size()); | 286 ASSERT_EQ(1U, m.size()); |
286 EXPECT_EQ(test_entries[4].url, m[0].destination_url.spec()); | 287 EXPECT_EQ(test_entries[4].url, m[0].destination_url.spec()); |
287 } | 288 } |
288 | 289 |
289 } // namespace | 290 } // namespace |
OLD | NEW |