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

Unified Diff: chrome/test/base/testing_profile.cc

Issue 777863002: Introduce new component webdata_services (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary DEPS on //ui, sort dependencies Created 6 years 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/test/base/testing_profile.cc
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index 2f5e6a0cd788481abba2c5419dd0f704c5c52170..a7c3d4ba081009e85f7f35af6b1dcd5963f57cda 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -49,6 +49,7 @@
#include "chrome/common/url_constants.h"
#include "chrome/test/base/history_index_restore_observer.h"
#include "chrome/test/base/testing_pref_service_syncable.h"
+#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/common/bookmark_constants.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
@@ -57,6 +58,7 @@
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/policy/core/common/policy_service.h"
#include "components/user_prefs/user_prefs.h"
+#include "components/webdata_services/web_data_service_wrapper.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/cookie_store_factory.h"
#include "content/public/browser/notification_service.h"
@@ -107,6 +109,12 @@ using testing::Return;
namespace {
+// Use for WebDataServiceWrapper constructor.
+void TestProfileErrorCallback(WebDataServiceWrapper::ErrorType error_type,
+ sql::InitStatus status) {
+ NOTREACHED();
+}
+
// Used to make sure TopSites has finished loading
class WaitTopSitesLoadedObserver : public history::TopSitesObserver {
public:
@@ -588,7 +596,18 @@ void TestingProfile::CreateBookmarkModel(bool delete_file) {
}
static KeyedService* BuildWebDataService(content::BrowserContext* profile) {
Peter Kasting 2014/12/05 21:47:56 Nit: While here: It's weird that this file has bot
sdefresne 2014/12/08 10:54:42 Done.
- return new WebDataServiceWrapper(static_cast<Profile*>(profile));
+ WebDataServiceWrapper* web_data_service_wrapper = new WebDataServiceWrapper(
+ static_cast<Profile*>(profile)->GetPath(),
+ g_browser_process->GetApplicationLocale(),
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB),
+ &TestProfileErrorCallback);
+ web_data_service_wrapper->GetAutofillWebData()->GetAutofillBackend(
+ base::Bind(&InitSyncableServicesOnDBThread,
+ web_data_service_wrapper->GetAutofillWebData(),
+ static_cast<Profile*>(profile)->GetPath(),
+ g_browser_process->GetApplicationLocale()));
+ return web_data_service_wrapper;
}
void TestingProfile::CreateWebDataService() {

Powered by Google App Engine
This is Rietveld 408576698