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

Unified Diff: chrome/browser/autocomplete/search_provider_unittest.cc

Issue 9811022: Misc. small cleanups to minimize TemplateURL refactoring diffs: (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autocomplete/search_provider_unittest.cc
===================================================================
--- chrome/browser/autocomplete/search_provider_unittest.cc (revision 128075)
+++ chrome/browser/autocomplete/search_provider_unittest.cc (working copy)
@@ -200,8 +200,8 @@
return;
ASSERT_GE(provider_->matches().size(), 1u);
EXPECT_TRUE(FindMatchWithDestination(GURL(
- default_t_url_->url()->ReplaceSearchTerms(*default_t_url_, text, 0,
- string16())), wyt_match));
+ default_t_url_->url()->ReplaceSearchTerms(*default_t_url_, text,
+ TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16())), wyt_match));
}
void SearchProviderTest::TearDown() {
@@ -216,7 +216,8 @@
int visit_count) {
HistoryService* history =
profile_.GetHistoryService(Profile::EXPLICIT_ACCESS);
- GURL search(t_url->url()->ReplaceSearchTerms(*t_url, term, 0, string16()));
+ GURL search(t_url->url()->ReplaceSearchTerms(*t_url, term,
+ TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16()));
static base::Time last_added_time;
last_added_time = std::max(base::Time::Now(),
last_added_time + base::TimeDelta::FromMicroseconds(1));
@@ -262,8 +263,9 @@
ASSERT_TRUE(fetcher);
// And the URL matches what we expected.
- GURL expected_url = GURL(default_t_url_->suggestions_url()->
- ReplaceSearchTerms(*default_t_url_, term, 0, string16()));
+ GURL expected_url(default_t_url_->suggestions_url()->ReplaceSearchTerms(
+ *default_t_url_, term, TemplateURLRef::NO_SUGGESTIONS_AVAILABLE,
+ string16()));
ASSERT_TRUE(fetcher->GetOriginalURL() == expected_url);
// Tell the SearchProvider the suggest query is done.
@@ -282,9 +284,9 @@
EXPECT_TRUE(term1_match.description.empty());
AutocompleteMatch wyt_match;
- EXPECT_TRUE(FindMatchWithDestination(GURL(
- default_t_url_->url()->ReplaceSearchTerms(*default_t_url_, term, 0,
- string16())), &wyt_match));
+ EXPECT_TRUE(FindMatchWithDestination(
+ GURL(default_t_url_->url()->ReplaceSearchTerms(*default_t_url_, term,
+ TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16())), &wyt_match));
EXPECT_TRUE(wyt_match.description.empty());
// The match for term1 should be more relevant than the what you typed result.
@@ -322,8 +324,9 @@
ASSERT_TRUE(keyword_fetcher);
// And the URL matches what we expected.
- GURL expected_url = GURL(keyword_t_url_->suggestions_url()->
- ReplaceSearchTerms(*keyword_t_url_, term, 0, string16()));
+ GURL expected_url(keyword_t_url_->suggestions_url()->ReplaceSearchTerms(
+ *keyword_t_url_, term, TemplateURLRef::NO_SUGGESTIONS_AVAILABLE,
+ string16()));
ASSERT_TRUE(keyword_fetcher->GetOriginalURL() == expected_url);
// Tell the SearchProvider the keyword suggest query is done.
@@ -391,8 +394,9 @@
// There should be two matches, one for what you typed, the other for
// 'foobar'.
EXPECT_EQ(2u, provider_->matches().size());
- GURL instant_url = GURL(default_t_url_->url()->ReplaceSearchTerms(
- *default_t_url_, ASCIIToUTF16("foobar"), 0, string16()));
+ GURL instant_url(default_t_url_->url()->ReplaceSearchTerms(*default_t_url_,
+ ASCIIToUTF16("foobar"), TemplateURLRef::NO_SUGGESTIONS_AVAILABLE,
+ string16()));
AutocompleteMatch instant_match;
EXPECT_TRUE(FindMatchWithDestination(instant_url, &instant_match));
@@ -401,9 +405,10 @@
// Make sure the what you typed match has no description.
AutocompleteMatch wyt_match;
- EXPECT_TRUE(FindMatchWithDestination(GURL(
- default_t_url_->url()->ReplaceSearchTerms(*default_t_url_,
- ASCIIToUTF16("foo"), 0, string16())), &wyt_match));
+ EXPECT_TRUE(FindMatchWithDestination(
+ GURL(default_t_url_->url()->ReplaceSearchTerms(*default_t_url_,
+ ASCIIToUTF16("foo"), TemplateURLRef::NO_SUGGESTIONS_AVAILABLE,
+ string16())), &wyt_match));
EXPECT_TRUE(wyt_match.description.empty());
// The instant search should be more relevant.
@@ -425,7 +430,8 @@
// 'foobar'.
EXPECT_EQ(2u, provider_->matches().size());
GURL instant_url(default_t_url_->url()->ReplaceSearchTerms(*default_t_url_,
- ASCIIToUTF16("foobar"), 0, string16()));
+ ASCIIToUTF16("foobar"), TemplateURLRef::NO_SUGGESTIONS_AVAILABLE,
+ string16()));
AutocompleteMatch instant_match;
EXPECT_TRUE(FindMatchWithDestination(instant_url, &instant_match));

Powered by Google App Engine
This is Rietveld 408576698