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_quick_provider.h" | 5 #include "chrome/browser/autocomplete/history_quick_provider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 | 255 |
256 void HistoryQuickProviderTest::RunTest(const base::string16 text, | 256 void HistoryQuickProviderTest::RunTest(const base::string16 text, |
257 bool prevent_inline_autocomplete, | 257 bool prevent_inline_autocomplete, |
258 std::vector<std::string> expected_urls, | 258 std::vector<std::string> expected_urls, |
259 bool can_inline_top_result, | 259 bool can_inline_top_result, |
260 base::string16 expected_fill_into_edit, | 260 base::string16 expected_fill_into_edit, |
261 base::string16 expected_autocompletion) { | 261 base::string16 expected_autocompletion) { |
262 SCOPED_TRACE(text); // Minimal hint to query being run. | 262 SCOPED_TRACE(text); // Minimal hint to query being run. |
263 base::MessageLoop::current()->RunUntilIdle(); | 263 base::MessageLoop::current()->RunUntilIdle(); |
264 AutocompleteInput input(text, base::string16::npos, base::string16(), | 264 AutocompleteInput input(text, base::string16::npos, base::string16(), |
265 GURL(), AutocompleteInput::INVALID_SPEC, | 265 GURL(), metrics::OmniboxEventProto::INVALID_SPEC, |
266 prevent_inline_autocomplete, false, true, true); | 266 prevent_inline_autocomplete, false, true, true); |
267 provider_->Start(input, false); | 267 provider_->Start(input, false); |
268 EXPECT_TRUE(provider_->done()); | 268 EXPECT_TRUE(provider_->done()); |
269 | 269 |
270 ac_matches_ = provider_->matches(); | 270 ac_matches_ = provider_->matches(); |
271 | 271 |
272 // We should have gotten back at most AutocompleteProvider::kMaxMatches. | 272 // We should have gotten back at most AutocompleteProvider::kMaxMatches. |
273 EXPECT_LE(ac_matches_.size(), AutocompleteProvider::kMaxMatches); | 273 EXPECT_LE(ac_matches_.size(), AutocompleteProvider::kMaxMatches); |
274 | 274 |
275 // If the number of expected and actual matches aren't equal then we need | 275 // If the number of expected and actual matches aren't equal then we need |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 | 730 |
731 TEST_F(HQPOrderingTest, TEAMatch) { | 731 TEST_F(HQPOrderingTest, TEAMatch) { |
732 std::vector<std::string> expected_urls; | 732 std::vector<std::string> expected_urls; |
733 expected_urls.push_back("http://www.teamliquid.net/"); | 733 expected_urls.push_back("http://www.teamliquid.net/"); |
734 expected_urls.push_back("http://www.teamliquid.net/tlpd"); | 734 expected_urls.push_back("http://www.teamliquid.net/tlpd"); |
735 expected_urls.push_back("http://www.teamliquid.net/tlpd/korean/players"); | 735 expected_urls.push_back("http://www.teamliquid.net/tlpd/korean/players"); |
736 RunTest(ASCIIToUTF16("tea"), false, expected_urls, true, | 736 RunTest(ASCIIToUTF16("tea"), false, expected_urls, true, |
737 ASCIIToUTF16("www.teamliquid.net"), | 737 ASCIIToUTF16("www.teamliquid.net"), |
738 ASCIIToUTF16("mliquid.net")); | 738 ASCIIToUTF16("mliquid.net")); |
739 } | 739 } |
OLD | NEW |