| 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/shortcuts_provider.h" | 5 #include "chrome/browser/autocomplete/shortcuts_provider.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <functional> | 10 #include <functional> |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 } | 353 } |
| 354 | 354 |
| 355 void ShortcutsProviderTest::RunTest( | 355 void ShortcutsProviderTest::RunTest( |
| 356 const base::string16 text, | 356 const base::string16 text, |
| 357 bool prevent_inline_autocomplete, | 357 bool prevent_inline_autocomplete, |
| 358 const ExpectedURLs& expected_urls, | 358 const ExpectedURLs& expected_urls, |
| 359 std::string expected_top_result, | 359 std::string expected_top_result, |
| 360 base::string16 top_result_inline_autocompletion) { | 360 base::string16 top_result_inline_autocompletion) { |
| 361 base::MessageLoop::current()->RunUntilIdle(); | 361 base::MessageLoop::current()->RunUntilIdle(); |
| 362 AutocompleteInput input(text, base::string16::npos, base::string16(), GURL(), | 362 AutocompleteInput input(text, base::string16::npos, base::string16(), GURL(), |
| 363 AutocompleteInput::INVALID_SPEC, | 363 metrics::OmniboxEventProto::INVALID_SPEC, |
| 364 prevent_inline_autocomplete, false, true, true); | 364 prevent_inline_autocomplete, false, true, true); |
| 365 provider_->Start(input, false); | 365 provider_->Start(input, false); |
| 366 EXPECT_TRUE(provider_->done()); | 366 EXPECT_TRUE(provider_->done()); |
| 367 | 367 |
| 368 ac_matches_ = provider_->matches(); | 368 ac_matches_ = provider_->matches(); |
| 369 | 369 |
| 370 // We should have gotten back at most AutocompleteProvider::kMaxMatches. | 370 // We should have gotten back at most AutocompleteProvider::kMaxMatches. |
| 371 EXPECT_LE(ac_matches_.size(), AutocompleteProvider::kMaxMatches); | 371 EXPECT_LE(ac_matches_.size(), AutocompleteProvider::kMaxMatches); |
| 372 | 372 |
| 373 // If the number of expected and actual matches aren't equal then we need | 373 // If the number of expected and actual matches aren't equal then we need |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 extensions::UnloadedExtensionInfo details( | 844 extensions::UnloadedExtensionInfo details( |
| 845 extension.get(), extensions::UnloadedExtensionInfo::REASON_UNINSTALL); | 845 extension.get(), extensions::UnloadedExtensionInfo::REASON_UNINSTALL); |
| 846 content::NotificationService::current()->Notify( | 846 content::NotificationService::current()->Notify( |
| 847 chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, | 847 chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, |
| 848 content::Source<Profile>(&profile_), | 848 content::Source<Profile>(&profile_), |
| 849 content::Details<extensions::UnloadedExtensionInfo>(&details)); | 849 content::Details<extensions::UnloadedExtensionInfo>(&details)); |
| 850 | 850 |
| 851 // Now the URL should have disappeared. | 851 // Now the URL should have disappeared. |
| 852 RunTest(text, false, ExpectedURLs(), std::string(), base::string16()); | 852 RunTest(text, false, ExpectedURLs(), std::string(), base::string16()); |
| 853 } | 853 } |
| OLD | NEW |