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 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 ASCIIToUTF16("popularsitewithroot.com"), base::string16()); | 727 ASCIIToUTF16("popularsitewithroot.com"), base::string16()); |
728 | 728 |
729 // The above still holds even with an extra trailing slash. | 729 // The above still holds even with an extra trailing slash. |
730 RunTest(ASCIIToUTF16("popularsitewithroot.com/"), true, expected_urls, true, | 730 RunTest(ASCIIToUTF16("popularsitewithroot.com/"), true, expected_urls, true, |
731 ASCIIToUTF16("popularsitewithroot.com"), base::string16()); | 731 ASCIIToUTF16("popularsitewithroot.com"), base::string16()); |
732 } | 732 } |
733 | 733 |
734 TEST_F(HistoryQuickProviderTest, CullSearchResults) { | 734 TEST_F(HistoryQuickProviderTest, CullSearchResults) { |
735 // Set up a default search engine. | 735 // Set up a default search engine. |
736 TemplateURLData data; | 736 TemplateURLData data; |
| 737 data.SetShortName(ASCIIToUTF16("TestEngine")); |
737 data.SetKeyword(ASCIIToUTF16("TestEngine")); | 738 data.SetKeyword(ASCIIToUTF16("TestEngine")); |
738 data.SetURL("http://testsearch.com/?q={searchTerms}"); | 739 data.SetURL("http://testsearch.com/?q={searchTerms}"); |
739 TemplateURLService* template_url_service = | 740 TemplateURLService* template_url_service = |
740 TemplateURLServiceFactory::GetForProfile(profile_.get()); | 741 TemplateURLServiceFactory::GetForProfile(profile_.get()); |
741 TemplateURL* template_url = new TemplateURL(data); | 742 TemplateURL* template_url = new TemplateURL(data); |
742 template_url_service->Add(template_url); | 743 template_url_service->Add(template_url); |
743 template_url_service->SetUserSelectedDefaultSearchProvider(template_url); | 744 template_url_service->SetUserSelectedDefaultSearchProvider(template_url); |
744 template_url_service->Load(); | 745 template_url_service->Load(); |
745 | 746 |
746 // A search results page should not be returned when typing a query. | 747 // A search results page should not be returned when typing a query. |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 | 829 |
829 TEST_F(HQPOrderingTest, TEAMatch) { | 830 TEST_F(HQPOrderingTest, TEAMatch) { |
830 std::vector<std::string> expected_urls; | 831 std::vector<std::string> expected_urls; |
831 expected_urls.push_back("http://www.teamliquid.net/"); | 832 expected_urls.push_back("http://www.teamliquid.net/"); |
832 expected_urls.push_back("http://www.teamliquid.net/tlpd"); | 833 expected_urls.push_back("http://www.teamliquid.net/tlpd"); |
833 expected_urls.push_back("http://www.teamliquid.net/tlpd/korean/players"); | 834 expected_urls.push_back("http://www.teamliquid.net/tlpd/korean/players"); |
834 RunTest(ASCIIToUTF16("tea"), false, expected_urls, true, | 835 RunTest(ASCIIToUTF16("tea"), false, expected_urls, true, |
835 ASCIIToUTF16("www.teamliquid.net"), | 836 ASCIIToUTF16("www.teamliquid.net"), |
836 ASCIIToUTF16("mliquid.net")); | 837 ASCIIToUTF16("mliquid.net")); |
837 } | 838 } |
OLD | NEW |