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

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

Issue 131433003: Refactor search and zero suggest providers to use common base class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More style + zero-suggest logic fixes Created 6 years, 11 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
« no previous file with comments | « chrome/browser/autocomplete/search_provider.cc ('k') | chrome/browser/autocomplete/zero_suggest_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/search_provider_unittest.cc
diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc
index c608d9b5ec6917d2b455ef6edf8f85ad46149203..729b14b2dfecf3f0e469dce44363452e0e7808a9 100644
--- a/chrome/browser/autocomplete/search_provider_unittest.cc
+++ b/chrome/browser/autocomplete/search_provider_unittest.cc
@@ -22,6 +22,7 @@
#include "chrome/browser/autocomplete/autocomplete_match.h"
#include "chrome/browser/autocomplete/autocomplete_provider.h"
#include "chrome/browser/autocomplete/autocomplete_provider_listener.h"
+#include "chrome/browser/autocomplete/base_search_provider.h"
#include "chrome/browser/autocomplete/history_url_provider.h"
#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
@@ -154,7 +155,9 @@ class SearchProviderTest : public testing::Test,
// Adds a search for |term|, using the engine |t_url| to the history, and
// returns the URL for that search.
- GURL AddSearchToHistory(TemplateURL* t_url, base::string16 term, int visit_count);
+ GURL AddSearchToHistory(TemplateURL* t_url,
+ base::string16 term,
+ int visit_count);
// Looks for a match in |provider_| with |contents| equal to |contents|.
// Sets |match| to it if found. Returns whether |match| was set.
@@ -273,8 +276,8 @@ void SearchProviderTest::SetUp() {
keyword_url_ = AddSearchToHistory(keyword_t_url_, keyword_term_, 1);
// Keywords are updated by the InMemoryHistoryBackend only after the message
- // has been processed on the history thread. Block until history processes all
- // requests to ensure the InMemoryDatabase is the state we expect it.
+ // has been processed on the history thread. Block until history processes
+ // all requests to ensure the InMemoryDatabase is the state we expect it.
profile_.BlockUntilHistoryProcessesPendingRequests();
provider_ = new SearchProviderForTest(this, &profile_);
@@ -378,8 +381,13 @@ GURL SearchProviderTest::AddSearchToHistory(TemplateURL* t_url,
static base::Time last_added_time;
last_added_time = std::max(base::Time::Now(),
last_added_time + base::TimeDelta::FromMicroseconds(1));
- history->AddPageWithDetails(search, base::string16(), visit_count, visit_count,
- last_added_time, false, history::SOURCE_BROWSED);
+ history->AddPageWithDetails(search,
+ base::string16(),
+ visit_count,
+ visit_count,
+ last_added_time,
+ false,
+ history::SOURCE_BROWSED);
history->SetKeywordSearchTermsForURL(search, t_url->id(), term);
return search;
}
@@ -3659,7 +3667,7 @@ TEST_F(SearchProviderTest, PrefetchMetadataParsing) {
EXPECT_EQ(cases[i].matches[j].contents,
base::UTF16ToUTF8(matches[j].contents));
EXPECT_EQ(cases[i].matches[j].allowed_to_be_prefetched,
- SearchProvider::ShouldPrefetch(matches[j]));
+ BaseSearchProvider::ShouldPrefetch(matches[j]));
EXPECT_EQ(cases[i].matches[j].type, matches[j].type);
EXPECT_EQ(cases[i].matches[j].from_keyword,
matches[j].keyword == ASCIIToUTF16("k"));
« no previous file with comments | « chrome/browser/autocomplete/search_provider.cc ('k') | chrome/browser/autocomplete/zero_suggest_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698