Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: chrome/browser/autocomplete/history_quick_provider_unittest.cc

Issue 338363004: Remove Profile* from TemplateURL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 ASCIIToUTF16("popularsitewithroot.com"), base::string16()); 642 ASCIIToUTF16("popularsitewithroot.com"), base::string16());
643 } 643 }
644 644
645 TEST_F(HistoryQuickProviderTest, CullSearchResults) { 645 TEST_F(HistoryQuickProviderTest, CullSearchResults) {
646 // Set up a default search engine. 646 // Set up a default search engine.
647 TemplateURLData data; 647 TemplateURLData data;
648 data.SetKeyword(ASCIIToUTF16("TestEngine")); 648 data.SetKeyword(ASCIIToUTF16("TestEngine"));
649 data.SetURL("http://testsearch.com/?q={searchTerms}"); 649 data.SetURL("http://testsearch.com/?q={searchTerms}");
650 TemplateURLService* template_url_service = 650 TemplateURLService* template_url_service =
651 TemplateURLServiceFactory::GetForProfile(profile_.get()); 651 TemplateURLServiceFactory::GetForProfile(profile_.get());
652 TemplateURL* template_url = new TemplateURL(profile_.get(), data); 652 TemplateURL* template_url = new TemplateURL(data);
653 template_url_service->Add(template_url); 653 template_url_service->Add(template_url);
654 template_url_service->SetUserSelectedDefaultSearchProvider(template_url); 654 template_url_service->SetUserSelectedDefaultSearchProvider(template_url);
655 template_url_service->Load(); 655 template_url_service->Load();
656 656
657 // A search results page should not be returned when typing a query. 657 // A search results page should not be returned when typing a query.
658 std::vector<std::string> expected_urls; 658 std::vector<std::string> expected_urls;
659 expected_urls.push_back("http://anotherengine.com/?q=thequery"); 659 expected_urls.push_back("http://anotherengine.com/?q=thequery");
660 RunTest(ASCIIToUTF16("thequery"), false, expected_urls, false, 660 RunTest(ASCIIToUTF16("thequery"), false, expected_urls, false,
661 ASCIIToUTF16("anotherengine.com/?q=thequery"), base::string16()); 661 ASCIIToUTF16("anotherengine.com/?q=thequery"), base::string16());
662 662
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/base_search_provider.cc ('k') | chrome/browser/autocomplete/history_url_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698