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