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

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

Issue 231863008: Rename SetDefaultSearchProvider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 8 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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 584
585 TEST_F(HistoryQuickProviderTest, CullSearchResults) { 585 TEST_F(HistoryQuickProviderTest, CullSearchResults) {
586 // Set up a default search engine. 586 // Set up a default search engine.
587 TemplateURLData data; 587 TemplateURLData data;
588 data.SetKeyword(ASCIIToUTF16("TestEngine")); 588 data.SetKeyword(ASCIIToUTF16("TestEngine"));
589 data.SetURL("http://testsearch.com/?q={searchTerms}"); 589 data.SetURL("http://testsearch.com/?q={searchTerms}");
590 TemplateURLService* template_url_service = 590 TemplateURLService* template_url_service =
591 TemplateURLServiceFactory::GetForProfile(profile_.get()); 591 TemplateURLServiceFactory::GetForProfile(profile_.get());
592 TemplateURL* template_url = new TemplateURL(profile_.get(), data); 592 TemplateURL* template_url = new TemplateURL(profile_.get(), data);
593 template_url_service->Add(template_url); 593 template_url_service->Add(template_url);
594 template_url_service->SetDefaultSearchProvider(template_url); 594 template_url_service->SetUserSelectedDefaultSearchProvider(template_url);
595 template_url_service->Load(); 595 template_url_service->Load();
596 596
597 // A search results page should not be returned when typing a query. 597 // A search results page should not be returned when typing a query.
598 std::vector<std::string> expected_urls; 598 std::vector<std::string> expected_urls;
599 expected_urls.push_back("http://anotherengine.com/?q=thequery"); 599 expected_urls.push_back("http://anotherengine.com/?q=thequery");
600 RunTest(ASCIIToUTF16("thequery"), false, expected_urls, false, 600 RunTest(ASCIIToUTF16("thequery"), false, expected_urls, false,
601 ASCIIToUTF16("anotherengine.com/?q=thequery"), base::string16()); 601 ASCIIToUTF16("anotherengine.com/?q=thequery"), base::string16());
602 602
603 // A search results page should not be returned when typing the engine URL. 603 // A search results page should not be returned when typing the engine URL.
604 expected_urls.clear(); 604 expected_urls.clear();
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 670
671 TEST_F(HQPOrderingTest, TEAMatch) { 671 TEST_F(HQPOrderingTest, TEAMatch) {
672 std::vector<std::string> expected_urls; 672 std::vector<std::string> expected_urls;
673 expected_urls.push_back("http://www.teamliquid.net/"); 673 expected_urls.push_back("http://www.teamliquid.net/");
674 expected_urls.push_back("http://www.teamliquid.net/tlpd"); 674 expected_urls.push_back("http://www.teamliquid.net/tlpd");
675 expected_urls.push_back("http://www.teamliquid.net/tlpd/korean/players"); 675 expected_urls.push_back("http://www.teamliquid.net/tlpd/korean/players");
676 RunTest(ASCIIToUTF16("tea"), false, expected_urls, true, 676 RunTest(ASCIIToUTF16("tea"), false, expected_urls, true,
677 ASCIIToUTF16("www.teamliquid.net"), 677 ASCIIToUTF16("www.teamliquid.net"),
678 ASCIIToUTF16("mliquid.net")); 678 ASCIIToUTF16("mliquid.net"));
679 } 679 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698