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

Unified Diff: chrome/browser/sync/test/integration/autofill_helper.cc

Issue 9834056: Moved WebDataService to ProfileKeyedService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: upload rebase Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/test/integration/autofill_helper.cc
diff --git a/chrome/browser/sync/test/integration/autofill_helper.cc b/chrome/browser/sync/test/integration/autofill_helper.cc
index b22b5041e01a64ebd4eb05bf8e54ea4eca4566e7..12c35f0499120b5647a7a339240316d70c10a8aa 100644
--- a/chrome/browser/sync/test/integration/autofill_helper.cc
+++ b/chrome/browser/sync/test/integration/autofill_helper.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "chrome/browser/webdata/autofill_entry.h"
#include "chrome/browser/webdata/autofill_table.h"
+#include "chrome/browser/webdata/web_data_service_factory.h"
#include "chrome/browser/webdata/web_database.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/test/base/thread_observer_helper.h"
@@ -58,7 +59,8 @@ void RemoveKeyDontBlockForSync(int profile, const AutofillKey& key) {
EXPECT_CALL(*observer_helper->observer(), Observe(_, _, _)).
WillOnce(SignalEvent(&done_event));
- WebDataService* wds = autofill_helper::GetWebDataService(profile);
+ scoped_refptr<WebDataService> wds =
+ autofill_helper::GetWebDataService(profile);
wds->RemoveFormValueForElementName(key.name(), key.value());
done_event.Wait();
}
@@ -144,8 +146,9 @@ AutofillProfile CreateAutofillProfile(ProfileType type) {
return profile;
}
-WebDataService* GetWebDataService(int index) {
- return test()->GetProfile(index)->GetWebDataService(Profile::EXPLICIT_ACCESS);
+scoped_refptr<WebDataService> GetWebDataService(int index) {
+ return WebDataServiceFactory::GetForProfile(
+ test()->GetProfile(index), Profile::EXPLICIT_ACCESS);
}
PersonalDataManager* GetPersonalDataManager(int index) {
@@ -170,7 +173,7 @@ void AddKeys(int profile, const std::set<AutofillKey>& keys) {
EXPECT_CALL(*observer_helper->observer(), Observe(_, _, _)).
WillOnce(SignalEvent(&done_event));
- WebDataService* wds = GetWebDataService(profile);
+ scoped_refptr<WebDataService> wds = GetWebDataService(profile);
wds->AddFormFields(form_fields);
done_event.Wait();
BlockForPendingDBThreadTasks();
@@ -191,7 +194,7 @@ void RemoveKeys(int profile) {
}
std::set<AutofillEntry> GetAllKeys(int profile) {
- WebDataService* wds = GetWebDataService(profile);
+ scoped_refptr<WebDataService> wds = GetWebDataService(profile);
std::vector<AutofillEntry> all_entries = GetAllAutofillEntries(wds);
std::set<AutofillEntry> all_keys;
for (std::vector<AutofillEntry>::const_iterator it = all_entries.begin();

Powered by Google App Engine
This is Rietveld 408576698