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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 MessageLoopForUI message_loop_; | 109 MessageLoopForUI message_loop_; |
110 content::TestBrowserThread ui_thread_; | 110 content::TestBrowserThread ui_thread_; |
111 content::TestBrowserThread file_thread_; | 111 content::TestBrowserThread file_thread_; |
112 | 112 |
113 scoped_ptr<TestingProfile> profile_; | 113 scoped_ptr<TestingProfile> profile_; |
114 scoped_refptr<HistoryContentsProvider> provider_; | 114 scoped_refptr<HistoryContentsProvider> provider_; |
115 }; | 115 }; |
116 | 116 |
117 class HistoryContentsProviderBodyOnlyTest : public HistoryContentsProviderTest { | 117 class HistoryContentsProviderBodyOnlyTest : public HistoryContentsProviderTest { |
118 protected: | 118 protected: |
119 virtual bool BodyOnly() { return true; } | 119 virtual bool BodyOnly() OVERRIDE { return true; } |
120 }; | 120 }; |
121 | 121 |
122 TEST_F(HistoryContentsProviderTest, Body) { | 122 TEST_F(HistoryContentsProviderTest, Body) { |
123 AutocompleteInput input(ASCIIToUTF16("FOO"), string16::npos, string16(), true, | 123 AutocompleteInput input(ASCIIToUTF16("FOO"), string16::npos, string16(), true, |
124 false, true, AutocompleteInput::ALL_MATCHES); | 124 false, true, AutocompleteInput::ALL_MATCHES); |
125 RunQuery(input, false); | 125 RunQuery(input, false); |
126 | 126 |
127 // The results should be the first two pages, in decreasing order. | 127 // The results should be the first two pages, in decreasing order. |
128 const ACMatches& m = matches(); | 128 const ACMatches& m = matches(); |
129 ASSERT_EQ(2U, m.size()); | 129 ASSERT_EQ(2U, m.size()); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 239 |
240 // Run a query that would only match history (but the history is deleted) | 240 // Run a query that would only match history (but the history is deleted) |
241 AutocompleteInput you_input(ASCIIToUTF16("you"), string16::npos, string16(), | 241 AutocompleteInput you_input(ASCIIToUTF16("you"), string16::npos, string16(), |
242 true, false, true, | 242 true, false, true, |
243 AutocompleteInput::ALL_MATCHES); | 243 AutocompleteInput::ALL_MATCHES); |
244 RunQuery(you_input, false); | 244 RunQuery(you_input, false); |
245 EXPECT_EQ(0U, matches().size()); | 245 EXPECT_EQ(0U, matches().size()); |
246 } | 246 } |
247 | 247 |
248 } // namespace | 248 } // namespace |
OLD | NEW |