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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 << "Results did not contain '" << expected << "' but should have."; | 220 << "Results did not contain '" << expected << "' but should have."; |
221 } | 221 } |
222 | 222 |
223 | 223 |
224 void HistoryQuickProviderTest::RunTest(const string16 text, | 224 void HistoryQuickProviderTest::RunTest(const string16 text, |
225 std::vector<std::string> expected_urls, | 225 std::vector<std::string> expected_urls, |
226 bool can_inline_top_result, | 226 bool can_inline_top_result, |
227 string16 expected_fill_into_edit) { | 227 string16 expected_fill_into_edit) { |
228 SCOPED_TRACE(text); // Minimal hint to query being run. | 228 SCOPED_TRACE(text); // Minimal hint to query being run. |
229 MessageLoop::current()->RunUntilIdle(); | 229 MessageLoop::current()->RunUntilIdle(); |
230 AutocompleteInput input(text, string16::npos, string16(), false, false, true, | 230 AutocompleteInput input(text, string16::npos, string16(), GURL(),false, false, |
231 AutocompleteInput::ALL_MATCHES); | 231 true, AutocompleteInput::ALL_MATCHES); |
232 provider_->Start(input, false); | 232 provider_->Start(input, false); |
233 EXPECT_TRUE(provider_->done()); | 233 EXPECT_TRUE(provider_->done()); |
234 | 234 |
235 ac_matches_ = provider_->matches(); | 235 ac_matches_ = provider_->matches(); |
236 | 236 |
237 // We should have gotten back at most AutocompleteProvider::kMaxMatches. | 237 // We should have gotten back at most AutocompleteProvider::kMaxMatches. |
238 EXPECT_LE(ac_matches_.size(), AutocompleteProvider::kMaxMatches); | 238 EXPECT_LE(ac_matches_.size(), AutocompleteProvider::kMaxMatches); |
239 | 239 |
240 // If the number of expected and actual matches aren't equal then we need | 240 // If the number of expected and actual matches aren't equal then we need |
241 // test no further, but let's do anyway so that we know which URLs failed. | 241 // test no further, but let's do anyway so that we know which URLs failed. |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 } | 613 } |
614 | 614 |
615 TEST_F(HQPOrderingTest, TEAMatch) { | 615 TEST_F(HQPOrderingTest, TEAMatch) { |
616 std::vector<std::string> expected_urls; | 616 std::vector<std::string> expected_urls; |
617 expected_urls.push_back("http://www.teamliquid.net/"); | 617 expected_urls.push_back("http://www.teamliquid.net/"); |
618 expected_urls.push_back("http://www.teamliquid.net/tlpd"); | 618 expected_urls.push_back("http://www.teamliquid.net/tlpd"); |
619 expected_urls.push_back("http://www.teamliquid.net/tlpd/korean/players"); | 619 expected_urls.push_back("http://www.teamliquid.net/tlpd/korean/players"); |
620 RunTest(ASCIIToUTF16("tea"), expected_urls, true, | 620 RunTest(ASCIIToUTF16("tea"), expected_urls, true, |
621 ASCIIToUTF16("www.teamliquid.net")); | 621 ASCIIToUTF16("www.teamliquid.net")); |
622 } | 622 } |
OLD | NEW |