OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "chrome/browser/autocomplete/autocomplete.h" | 8 #include "chrome/browser/autocomplete/autocomplete.h" |
9 #include "chrome/browser/autocomplete/history_contents_provider.h" | 9 #include "chrome/browser/autocomplete/history_contents_provider.h" |
10 #include "chrome/browser/chrome_thread.h" | 10 #include "chrome/browser/chrome_thread.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 const ACMatches& matches() const { return provider_->matches(); } | 47 const ACMatches& matches() const { return provider_->matches(); } |
48 | 48 |
49 TestingProfile* profile() const { return profile_.get(); } | 49 TestingProfile* profile() const { return profile_.get(); } |
50 | 50 |
51 HistoryContentsProvider* provider() const { return provider_.get(); } | 51 HistoryContentsProvider* provider() const { return provider_.get(); } |
52 | 52 |
53 private: | 53 private: |
54 // testing::Test | 54 // testing::Test |
55 virtual void SetUp() { | 55 virtual void SetUp() { |
56 profile_.reset(new TestingProfile()); | 56 profile_.reset(new TestingProfile()); |
57 profile_->CreateHistoryService(false); | 57 profile_->CreateHistoryService(false, false); |
58 | 58 |
59 HistoryService* history_service = | 59 HistoryService* history_service = |
60 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS); | 60 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS); |
61 | 61 |
62 // Populate history. | 62 // Populate history. |
63 for (size_t i = 0; i < arraysize(test_entries); i++) { | 63 for (size_t i = 0; i < arraysize(test_entries); i++) { |
64 // We need the ID scope and page ID so that the visit tracker can find it. | 64 // We need the ID scope and page ID so that the visit tracker can find it. |
65 // We just use the index for the page ID below. | 65 // We just use the index for the page ID below. |
66 const void* id_scope = reinterpret_cast<void*>(1); | 66 const void* id_scope = reinterpret_cast<void*>(1); |
67 GURL url(test_entries[i].url); | 67 GURL url(test_entries[i].url); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 ASSERT_EQ(2U, m3.size()); | 181 ASSERT_EQ(2U, m3.size()); |
182 if (bookmark_url == m3[0].destination_url) { | 182 if (bookmark_url == m3[0].destination_url) { |
183 EXPECT_EQ("http://www.google.com/3", m3[1].destination_url.spec()); | 183 EXPECT_EQ("http://www.google.com/3", m3[1].destination_url.spec()); |
184 } else { | 184 } else { |
185 EXPECT_EQ(bookmark_url, m3[1].destination_url); | 185 EXPECT_EQ(bookmark_url, m3[1].destination_url); |
186 EXPECT_EQ("http://www.google.com/3", m3[0].destination_url.spec()); | 186 EXPECT_EQ("http://www.google.com/3", m3[0].destination_url.spec()); |
187 } | 187 } |
188 } | 188 } |
189 | 189 |
190 } // namespace | 190 } // namespace |
OLD | NEW |