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

Unified Diff: chrome/test/live_sync/autofill_helper.h

Issue 7536001: Re-land: Allow sync integration tests to operate on multiple datatypes: Autofill (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on trunk (once again) Created 9 years, 5 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/chrome_tests.gypi ('k') | chrome/test/live_sync/autofill_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/live_sync/autofill_helper.h
diff --git a/chrome/test/live_sync/live_autofill_sync_test.h b/chrome/test/live_sync/autofill_helper.h
similarity index 51%
rename from chrome/test/live_sync/live_autofill_sync_test.h
rename to chrome/test/live_sync/autofill_helper.h
index c5bb58a2ef8fd273561ec38168b55f156c18d249..0c3dee49f3a31b98bde462f11d6a774efe2e7585 100644
--- a/chrome/test/live_sync/live_autofill_sync_test.h
+++ b/chrome/test/live_sync/autofill_helper.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_TEST_LIVE_SYNC_LIVE_AUTOFILL_SYNC_TEST_H_
-#define CHROME_TEST_LIVE_SYNC_LIVE_AUTOFILL_SYNC_TEST_H_
+#ifndef CHROME_TEST_LIVE_SYNC_AUTOFILL_HELPER_H_
+#define CHROME_TEST_LIVE_SYNC_AUTOFILL_HELPER_H_
#pragma once
#include <set>
@@ -11,14 +11,14 @@
#include "base/compiler_specific.h"
#include "chrome/browser/autofill/personal_data_manager.h"
-#include "chrome/test/live_sync/live_sync_test.h"
+#include "chrome/test/live_sync/sync_datatype_helper.h"
class AutofillEntry;
class AutofillKey;
class AutofillProfile;
class WebDataService;
-class LiveAutofillSyncTest : public LiveSyncTest {
+class AutofillHelper : public SyncDatatypeHelper {
public:
enum ProfileType {
PROFILE_MARION,
@@ -27,78 +27,72 @@ class LiveAutofillSyncTest : public LiveSyncTest {
PROFILE_NULL
};
- explicit LiveAutofillSyncTest(TestType test_type);
- virtual ~LiveAutofillSyncTest();
-
// Used to access the web data service within a particular sync profile.
- WebDataService* GetWebDataService(int index) WARN_UNUSED_RESULT;
+ static WebDataService* GetWebDataService(int index) WARN_UNUSED_RESULT;
// Used to access the personal data manager within a particular sync profile.
- PersonalDataManager* GetPersonalDataManager(int index) WARN_UNUSED_RESULT;
+ static PersonalDataManager* GetPersonalDataManager(
+ int index) WARN_UNUSED_RESULT;
// Adds the form fields in |keys| to the WebDataService of sync profile
// |profile|.
- void AddKeys(int profile, const std::set<AutofillKey>& keys);
+ static void AddKeys(int profile, const std::set<AutofillKey>& keys);
+
// Removes the form field in |key| from the WebDataService of sync profile
// |profile|.
- void RemoveKey(int profile, const AutofillKey& key);
+ static void RemoveKey(int profile, const AutofillKey& key);
// Gets all the form fields in the WebDataService of sync profile |profile|.
- std::set<AutofillEntry> GetAllKeys(int profile) WARN_UNUSED_RESULT;
+ static std::set<AutofillEntry> GetAllKeys(int profile) WARN_UNUSED_RESULT;
// Compares the form fields in the WebDataServices of sync profiles
// |profile_a| and |profile_b|. Returns true if they match.
- bool KeysMatch(int profile_a, int profile_b) WARN_UNUSED_RESULT;
+ static bool KeysMatch(int profile_a, int profile_b) WARN_UNUSED_RESULT;
// Replaces the Autofill profiles in sync profile |profile| with
// |autofill_profiles|.
- void SetProfiles(
- int profile, std::vector<AutofillProfile>* autofill_profiles);
+ static void SetProfiles(int profile,
+ std::vector<AutofillProfile>* autofill_profiles);
// Adds the autofill profile |autofill_profile| to sync profile |profile|.
- void AddProfile(int profile, const AutofillProfile& autofill_profile);
+ static void AddProfile(int profile, const AutofillProfile& autofill_profile);
// Removes the autofill profile with guid |guid| from sync profile
// |profile|.
- void RemoveProfile(int profile, const std::string& guid);
+ static void RemoveProfile(int profile, const std::string& guid);
// Updates the autofill profile with guid |guid| in sync profile |profile|
// to |type| and |value|.
- void UpdateProfile(int profile,
- const std::string& guid,
- const AutofillType& type,
- const string16& value);
+ static void UpdateProfile(int profile,
+ const std::string& guid,
+ const AutofillType& type,
+ const string16& value);
// Gets all the Autofill profiles in the PersonalDataManager of sync profile
// |profile|.
- const std::vector<AutofillProfile*>& GetAllProfiles(int profile)
- WARN_UNUSED_RESULT;
+ static const std::vector<AutofillProfile*>& GetAllProfiles(
+ int profile) WARN_UNUSED_RESULT;
// Returns the number of autofill profiles contained by sync profile
// |profile|.
- int GetProfileCount(int profile);
+ static int GetProfileCount(int profile);
// Compares the Autofill profiles in the PersonalDataManagers of sync profiles
// |profile_a| and |profile_b|. Returns true if they match.
- bool ProfilesMatch(int profile_a, int profile_b) WARN_UNUSED_RESULT;
+ static bool ProfilesMatch(int profile_a, int profile_b) WARN_UNUSED_RESULT;
// Compares the autofill profiles for all sync profiles, and returns true if
// they all match.
- bool AllProfilesMatch() WARN_UNUSED_RESULT;
+ static bool AllProfilesMatch() WARN_UNUSED_RESULT;
- private:
- DISALLOW_COPY_AND_ASSIGN(LiveAutofillSyncTest);
-};
-
-AutofillProfile CreateAutofillProfile(LiveAutofillSyncTest::ProfileType type);
-
-class TwoClientLiveAutofillSyncTest : public LiveAutofillSyncTest {
- public:
- TwoClientLiveAutofillSyncTest() : LiveAutofillSyncTest(TWO_CLIENT) {}
- virtual ~TwoClientLiveAutofillSyncTest() {}
+ // Creates a test autofill profile based on the persona specified in |type|.
+ static AutofillProfile CreateAutofillProfile(ProfileType type);
+ protected:
+ AutofillHelper();
+ virtual ~AutofillHelper();
private:
- DISALLOW_COPY_AND_ASSIGN(TwoClientLiveAutofillSyncTest);
+ DISALLOW_COPY_AND_ASSIGN(AutofillHelper);
};
-#endif // CHROME_TEST_LIVE_SYNC_LIVE_AUTOFILL_SYNC_TEST_H_
+#endif // CHROME_TEST_LIVE_SYNC_AUTOFILL_HELPER_H_
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/live_sync/autofill_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698