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 "chrome/browser/autocomplete/search_provider.h" | 5 #include "chrome/browser/autocomplete/search_provider.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 } | 160 } |
161 | 161 |
162 void SearchProviderTest::RunTillProviderDone() { | 162 void SearchProviderTest::RunTillProviderDone() { |
163 if (provider_->done()) | 163 if (provider_->done()) |
164 return; | 164 return; |
165 | 165 |
166 quit_when_done_ = true; | 166 quit_when_done_ = true; |
167 #if defined(OS_MACOSX) | 167 #if defined(OS_MACOSX) |
168 message_loop_.Run(); | 168 message_loop_.Run(); |
169 #else | 169 #else |
170 message_loop_.Run(NULL); | 170 message_loop_.RunWithDispatcher(NULL); |
171 #endif | 171 #endif |
172 } | 172 } |
173 | 173 |
174 void SearchProviderTest::QueryForInput(const string16& text, | 174 void SearchProviderTest::QueryForInput(const string16& text, |
175 bool prevent_inline_autocomplete) { | 175 bool prevent_inline_autocomplete) { |
176 // Start a query. | 176 // Start a query. |
177 AutocompleteInput input(text, string16(), prevent_inline_autocomplete, | 177 AutocompleteInput input(text, string16(), prevent_inline_autocomplete, |
178 false, true, AutocompleteInput::ALL_MATCHES); | 178 false, true, AutocompleteInput::ALL_MATCHES); |
179 provider_->Start(input, false); | 179 provider_->Start(input, false); |
180 | 180 |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 fetcher = NULL; | 657 fetcher = NULL; |
658 | 658 |
659 // Run till the history results complete. | 659 // Run till the history results complete. |
660 RunTillProviderDone(); | 660 RunTillProviderDone(); |
661 | 661 |
662 // Make sure there is a match for 'a.com' and it doesn't have a template_url. | 662 // Make sure there is a match for 'a.com' and it doesn't have a template_url. |
663 AutocompleteMatch nav_match; | 663 AutocompleteMatch nav_match; |
664 EXPECT_TRUE(FindMatchWithDestination(GURL("http://a.com"), &nav_match)); | 664 EXPECT_TRUE(FindMatchWithDestination(GURL("http://a.com"), &nav_match)); |
665 EXPECT_FALSE(nav_match.template_url); | 665 EXPECT_FALSE(nav_match.template_url); |
666 } | 666 } |
OLD | NEW |