| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 Profile* profile = static_cast<Profile*>(context); | 130 Profile* profile = static_cast<Profile*>(context); |
| 131 return new TemplateURLService( | 131 return new TemplateURLService( |
| 132 profile->GetPrefs(), make_scoped_ptr(new SearchTermsData), NULL, | 132 profile->GetPrefs(), make_scoped_ptr(new SearchTermsData), NULL, |
| 133 scoped_ptr<TemplateURLServiceClient>( | 133 scoped_ptr<TemplateURLServiceClient>( |
| 134 new ChromeTemplateURLServiceClient( | 134 new ChromeTemplateURLServiceClient( |
| 135 HistoryServiceFactory::GetForProfile( | 135 HistoryServiceFactory::GetForProfile( |
| 136 profile, Profile::EXPLICIT_ACCESS))), | 136 profile, Profile::EXPLICIT_ACCESS))), |
| 137 NULL, NULL, base::Closure()); | 137 NULL, NULL, base::Closure()); |
| 138 } | 138 } |
| 139 | 139 |
| 140 virtual void SetUp(); | 140 void SetUp() override; |
| 141 virtual void TearDown(); | 141 void TearDown() override; |
| 142 | 142 |
| 143 virtual void GetTestData(size_t* data_count, TestURLInfo** test_data); | 143 virtual void GetTestData(size_t* data_count, TestURLInfo** test_data); |
| 144 | 144 |
| 145 // Fills test data into the history system. | 145 // Fills test data into the history system. |
| 146 void FillData(); | 146 void FillData(); |
| 147 | 147 |
| 148 // Runs an autocomplete query on |text| and checks to see that the returned | 148 // Runs an autocomplete query on |text| and checks to see that the returned |
| 149 // results' destination URLs match those provided. |expected_urls| does not | 149 // results' destination URLs match those provided. |expected_urls| does not |
| 150 // need to be in sorted order. | 150 // need to be in sorted order. |
| 151 void RunTest(const base::string16 text, | 151 void RunTest(const base::string16 text, |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 | 776 |
| 777 TEST_F(HQPOrderingTest, TEAMatch) { | 777 TEST_F(HQPOrderingTest, TEAMatch) { |
| 778 std::vector<std::string> expected_urls; | 778 std::vector<std::string> expected_urls; |
| 779 expected_urls.push_back("http://www.teamliquid.net/"); | 779 expected_urls.push_back("http://www.teamliquid.net/"); |
| 780 expected_urls.push_back("http://www.teamliquid.net/tlpd"); | 780 expected_urls.push_back("http://www.teamliquid.net/tlpd"); |
| 781 expected_urls.push_back("http://www.teamliquid.net/tlpd/korean/players"); | 781 expected_urls.push_back("http://www.teamliquid.net/tlpd/korean/players"); |
| 782 RunTest(ASCIIToUTF16("tea"), false, expected_urls, true, | 782 RunTest(ASCIIToUTF16("tea"), false, expected_urls, true, |
| 783 ASCIIToUTF16("www.teamliquid.net"), | 783 ASCIIToUTF16("www.teamliquid.net"), |
| 784 ASCIIToUTF16("mliquid.net")); | 784 ASCIIToUTF16("mliquid.net")); |
| 785 } | 785 } |
| OLD | NEW |