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

Unified Diff: chrome/browser/search_engines/template_url_service_test_util.h

Issue 513133002: Move TemplateURLService related tests to components/search_engines (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 6 years, 4 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/search_engines/template_url_service_test_util.h
diff --git a/chrome/browser/search_engines/template_url_service_test_util.h b/chrome/browser/search_engines/template_url_service_test_util.h
index 4833a9acdaa3330fbc130e2e9f715758e7adc765..661f9b0d5b0c58d0bf610b8c04d24f2d700b2e30 100644
--- a/chrome/browser/search_engines/template_url_service_test_util.h
+++ b/chrome/browser/search_engines/template_url_service_test_util.h
@@ -9,16 +9,16 @@
#include "base/basictypes.h"
#include "base/files/scoped_temp_dir.h"
+#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
#include "components/search_engines/template_url_service_observer.h"
-#include "content/public/test/test_browser_thread_bundle.h"
class GURL;
+class KeywordWebDataService;
class TemplateURLService;
class TestingProfile;
class TestingSearchTermsData;
-class TestingTemplateURLService;
class TemplateURLServiceTestUtil : public TemplateURLServiceObserver {
public:
@@ -52,12 +52,12 @@ class TemplateURLServiceTestUtil : public TemplateURLServiceObserver {
// TemplateURLService::SetKeywordSearchTermsForURL and clears the search term.
base::string16 GetAndClearSearchTerm();
- // Set the google base url. |base_url| must be valid.
+ // Sets the google base url. |base_url| must be valid.
void SetGoogleBaseURL(const GURL& base_url);
- // Set the managed preferences for the default search provider and trigger
+ // Sets the managed preferences for the default search provider and trigger
// notification. If |alternate_url| is empty, uses an empty list of alternate
- // URLs, otherwise use a list containing a single entry.
+ // URLs, otherwise uses a list containing a single entry.
void SetManagedDefaultSearchPreferences(
bool enabled,
const std::string& name,
@@ -69,23 +69,22 @@ class TemplateURLServiceTestUtil : public TemplateURLServiceObserver {
const std::string& alternate_url,
const std::string& search_terms_replacement_key);
- // Remove all the managed preferences for the default search provider and
- // trigger notification.
+ // Removes all the managed preferences for the default search provider and
+ // triggers notification.
void RemoveManagedDefaultSearchPreferences();
- // Returns the TemplateURLService.
- TemplateURLService* model();
-
- // Returns the TestingProfile.
+ KeywordWebDataService* web_data_service() { return web_data_service_.get(); }
+ TemplateURLService* model() { return model_.get(); }
TestingProfile* profile() { return profile_.get(); }
private:
- content::TestBrowserThreadBundle thread_bundle_;
scoped_ptr<TestingProfile> profile_;
base::ScopedTempDir temp_dir_;
int changed_count_;
+ base::string16 search_term_;
+ scoped_refptr<KeywordWebDataService> web_data_service_;
TestingSearchTermsData* search_terms_data_;
- scoped_ptr<TestingTemplateURLService> model_;
+ scoped_ptr<TemplateURLService> model_;
DISALLOW_COPY_AND_ASSIGN(TemplateURLServiceTestUtil);
};

Powered by Google App Engine
This is Rietveld 408576698