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

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

Issue 7104072: Adding new extension sync integration tests. Also modified the way that profile (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: More review changes Created 9 years, 6 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/test/live_sync/live_sync_extension_helper.h
diff --git a/chrome/test/live_sync/live_sync_extension_helper.h b/chrome/test/live_sync/live_sync_extension_helper.h
index 188d9b304492385891abfb4cca6ef51b53235c49..107b7fede31e3d85cffdc4c930460718faba58bc 100644
--- a/chrome/test/live_sync/live_sync_extension_helper.h
+++ b/chrome/test/live_sync/live_sync_extension_helper.h
@@ -20,10 +20,6 @@ class Profile;
class LiveSyncExtensionHelper {
public:
- enum ExtensionState { DISABLED, PENDING, ENABLED };
-
- typedef std::map<std::string, ExtensionState> ExtensionStateMap;
-
LiveSyncExtensionHelper();
~LiveSyncExtensionHelper();
@@ -41,6 +37,18 @@ class LiveSyncExtensionHelper {
// Uninstalls the extension with the given name from |profile|.
void UninstallExtension(Profile* profile, const std::string& name);
+ // Enables the extension with the given name on |profile|.
+ void EnableExtension(Profile* profile, const std::string& name);
+
+ // Disables the extension with the given name on |profile|.
+ void DisableExtension(Profile* profile, const std::string& name);
+
+ // Enables the extension with the given name to run in incognito mode
+ void IncognitoEnableExtension(Profile* profile, const std::string& name);
+
+ // Disables the extension with the given name from running in incognito mode
+ void IncognitoDisableExtension(Profile* profile, const std::string& name);
+
// Returns true iff the extension with the given id is pending
// install in |profile|.
bool IsExtensionPendingInstallForSync(
@@ -50,15 +58,30 @@ class LiveSyncExtensionHelper {
// type.
void InstallExtensionsPendingForSync(Profile* profile, Extension::Type type);
- // Returns a map from |profile|'s installed extensions to their
- // state.
- ExtensionStateMap GetExtensionStates(Profile* profile) const;
+ // Returns true iff |profile1| and |profile2| have the same extensions and
+ // they are all in the same state.
+ static bool ExtensionStatesMatch(Profile* profile1, Profile* profile2);
private:
+ struct ExtensionState {
+ enum EnabledState { DISABLED, PENDING, ENABLED };
+
+ ExtensionState();
+ ~ExtensionState();
+ bool Equals(const ExtensionState &other) const;
+
+ EnabledState enabled_state;
+ bool incognito_enabled;
+ };
+
+ typedef std::map<std::string, ExtensionState> ExtensionStateMap;
typedef std::map<std::string, scoped_refptr<Extension> > ExtensionNameMap;
typedef std::map<Profile*, ExtensionNameMap> ProfileExtensionNameMap;
typedef std::map<std::string, std::string> StringMap;
+ // Returns a map from |profile|'s installed extensions to their state.
+ static ExtensionStateMap GetExtensionStates(Profile* profile);
+
// Initializes extensions for |profile| and creates an entry in
// |profile_extensions_| for it.
void SetupProfile(Profile* profile);
« no previous file with comments | « chrome/test/live_sync/live_extensions_sync_test.cc ('k') | chrome/test/live_sync/live_sync_extension_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698