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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 explicit SetShouldContain(const ACMatches& matched_urls); | 104 explicit SetShouldContain(const ACMatches& matched_urls); |
105 | 105 |
106 void operator()(const std::string& expected); | 106 void operator()(const std::string& expected); |
107 | 107 |
108 std::set<std::string> LeftOvers() const { return matches_; } | 108 std::set<std::string> LeftOvers() const { return matches_; } |
109 | 109 |
110 private: | 110 private: |
111 std::set<std::string> matches_; | 111 std::set<std::string> matches_; |
112 }; | 112 }; |
113 | 113 |
114 static ProfileKeyedService* CreateTemplateURLService(Profile* profile) { | 114 static ProfileKeyedService* CreateTemplateURLService( |
115 return new TemplateURLService(profile); | 115 content::BrowserContext* profile) { |
| 116 return new TemplateURLService(static_cast<Profile*>(profile)); |
116 } | 117 } |
117 | 118 |
118 virtual void SetUp(); | 119 virtual void SetUp(); |
119 virtual void TearDown(); | 120 virtual void TearDown(); |
120 | 121 |
121 virtual void GetTestData(size_t* data_count, TestURLInfo** test_data); | 122 virtual void GetTestData(size_t* data_count, TestURLInfo** test_data); |
122 | 123 |
123 // Fills test data into the history system. | 124 // Fills test data into the history system. |
124 void FillData(); | 125 void FillData(); |
125 | 126 |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 } | 615 } |
615 | 616 |
616 TEST_F(HQPOrderingTest, TEAMatch) { | 617 TEST_F(HQPOrderingTest, TEAMatch) { |
617 std::vector<std::string> expected_urls; | 618 std::vector<std::string> expected_urls; |
618 expected_urls.push_back("http://www.teamliquid.net/"); | 619 expected_urls.push_back("http://www.teamliquid.net/"); |
619 expected_urls.push_back("http://www.teamliquid.net/tlpd"); | 620 expected_urls.push_back("http://www.teamliquid.net/tlpd"); |
620 expected_urls.push_back("http://www.teamliquid.net/tlpd/korean/players"); | 621 expected_urls.push_back("http://www.teamliquid.net/tlpd/korean/players"); |
621 RunTest(ASCIIToUTF16("tea"), expected_urls, true, | 622 RunTest(ASCIIToUTF16("tea"), expected_urls, true, |
622 ASCIIToUTF16("www.teamliquid.net")); | 623 ASCIIToUTF16("www.teamliquid.net")); |
623 } | 624 } |
OLD | NEW |