OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/autocomplete/autocomplete.h" | 9 #include "chrome/browser/autocomplete/autocomplete.h" |
10 #include "chrome/browser/autocomplete/autocomplete_match.h" | 10 #include "chrome/browser/autocomplete/autocomplete_match.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 virtual void TearDown() { | 92 virtual void TearDown() { |
93 provider_ = NULL; | 93 provider_ = NULL; |
94 profile_.reset(NULL); | 94 profile_.reset(NULL); |
95 } | 95 } |
96 | 96 |
97 // ACProviderListener | 97 // ACProviderListener |
98 virtual void OnProviderUpdate(bool updated_matches) { | 98 virtual void OnProviderUpdate(bool updated_matches) { |
99 // We must quit the message loop (if running) to return control to the test. | 99 // We must quit the message loop (if running) to return control to the test. |
100 // Note, calling Quit() directly will checkfail if the loop isn't running, | 100 // Note, calling Quit() directly will checkfail if the loop isn't running, |
101 // so we post a task, which is safe for either case. | 101 // so we post a task, which is safe for either case. |
102 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); | 102 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
103 } | 103 } |
104 | 104 |
105 MessageLoopForUI message_loop_; | 105 MessageLoopForUI message_loop_; |
106 content::TestBrowserThread ui_thread_; | 106 content::TestBrowserThread ui_thread_; |
107 content::TestBrowserThread file_thread_; | 107 content::TestBrowserThread file_thread_; |
108 | 108 |
109 scoped_ptr<TestingProfile> profile_; | 109 scoped_ptr<TestingProfile> profile_; |
110 scoped_refptr<HistoryContentsProvider> provider_; | 110 scoped_refptr<HistoryContentsProvider> provider_; |
111 }; | 111 }; |
112 | 112 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 true, AutocompleteInput::ALL_MATCHES); | 276 true, AutocompleteInput::ALL_MATCHES); |
277 RunQuery(you_input, false); | 277 RunQuery(you_input, false); |
278 EXPECT_EQ(0U, matches().size()); | 278 EXPECT_EQ(0U, matches().size()); |
279 | 279 |
280 // Run a query that matches the bookmark | 280 // Run a query that matches the bookmark |
281 RunQuery(input, false); | 281 RunQuery(input, false); |
282 EXPECT_EQ(1U, matches().size()); | 282 EXPECT_EQ(1U, matches().size()); |
283 } | 283 } |
284 | 284 |
285 } // namespace | 285 } // namespace |
OLD | NEW |