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

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

Issue 7599019: Allow sync integration tests to operate on multiple datatypes: Apps, Extensions, Themes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix indents Created 9 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/test/live_sync/sync_extension_helper.h
diff --git a/chrome/test/live_sync/live_sync_extension_helper.h b/chrome/test/live_sync/sync_extension_helper.h
similarity index 87%
rename from chrome/test/live_sync/live_sync_extension_helper.h
rename to chrome/test/live_sync/sync_extension_helper.h
index da66563cf9bf3acb6034dcdb9c611627d161c10d..45bdb4165bc54f579077dc39b1102f29ad0f3083 100644
--- a/chrome/test/live_sync/live_sync_extension_helper.h
+++ b/chrome/test/live_sync/sync_extension_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_SYNC_EXTENSION_HELPER_H_
-#define CHROME_TEST_LIVE_SYNC_LIVE_SYNC_EXTENSION_HELPER_H_
+#ifndef CHROME_TEST_LIVE_SYNC_SYNC_EXTENSION_HELPER_H_
+#define CHROME_TEST_LIVE_SYNC_SYNC_EXTENSION_HELPER_H_
#pragma once
#include <map>
@@ -13,23 +13,24 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/singleton.h"
#include "chrome/common/extensions/extension.h"
class Extension;
class LiveSyncTest;
class Profile;
-class LiveSyncExtensionHelper {
+class SyncExtensionHelper {
public:
- LiveSyncExtensionHelper();
- ~LiveSyncExtensionHelper();
+ // Singleton implementation.
+ static SyncExtensionHelper* GetInstance();
// Returns a generated extension ID for the given name.
static std::string NameToId(const std::string& name);
// Initializes the profiles in |test| and registers them with
// internal data structures.
- void Setup(LiveSyncTest* test);
+ void SetupIfNecessary(LiveSyncTest* test);
// Installs the extension with the given name to |profile|.
void InstallExtension(
@@ -90,6 +91,11 @@ class LiveSyncExtensionHelper {
typedef std::map<Profile*, ExtensionNameMap> ProfileExtensionNameMap;
typedef std::map<std::string, std::string> StringMap;
+ friend struct DefaultSingletonTraits<SyncExtensionHelper>;
+
+ SyncExtensionHelper();
+ ~SyncExtensionHelper();
+
// Returns a map from |profile|'s installed extensions to their state.
static ExtensionStateMap GetExtensionStates(Profile* profile);
@@ -106,8 +112,9 @@ class LiveSyncExtensionHelper {
ProfileExtensionNameMap profile_extensions_;
StringMap id_to_name_;
+ bool setup_completed_;
- DISALLOW_COPY_AND_ASSIGN(LiveSyncExtensionHelper);
+ DISALLOW_COPY_AND_ASSIGN(SyncExtensionHelper);
};
-#endif // CHROME_TEST_LIVE_SYNC_LIVE_SYNC_EXTENSION_HELPER_H_
+#endif // CHROME_TEST_LIVE_SYNC_SYNC_EXTENSION_HELPER_H_
« no previous file with comments | « chrome/test/live_sync/single_client_themes_sync_test.cc ('k') | chrome/test/live_sync/sync_extension_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698