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

Unified Diff: chrome/test/live_sync/apps_helper.cc

Issue 7828055: Move sync test code out of chrome/test (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' 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
« no previous file with comments | « chrome/test/live_sync/apps_helper.h ('k') | chrome/test/live_sync/autofill_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/live_sync/apps_helper.cc
===================================================================
--- chrome/test/live_sync/apps_helper.cc (revision 99413)
+++ chrome/test/live_sync/apps_helper.cc (working copy)
@@ -1,78 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/test/live_sync/apps_helper.h"
-
-#include "base/logging.h"
-#include "base/string_number_conversions.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/common/extensions/extension.h"
-#include "chrome/test/live_sync/sync_datatype_helper.h"
-#include "chrome/test/live_sync/sync_extension_helper.h"
-
-using sync_datatype_helper::test;
-
-namespace {
-
-std::string CreateFakeAppName(int index) {
- return "fakeapp" + base::IntToString(index);
-}
-
-} // namespace
-
-namespace apps_helper {
-
-bool HasSameAppsAsVerifier(int index) {
- // TODO(akalin): We may want to filter out non-apps for some tests.
- return SyncExtensionHelper::GetInstance()->ExtensionStatesMatch(
- test()->GetProfile(index), test()->verifier());
-}
-
-bool AllProfilesHaveSameAppsAsVerifier() {
- for (int i = 0; i < test()->num_clients(); ++i) {
- if (!HasSameAppsAsVerifier(i)) {
- LOG(ERROR) << "Profile " << i << " doesn't have the same apps as the"
- " verifier profile.";
- return false;
- }
- }
- return true;
-}
-
-void InstallApp(Profile* profile, int index) {
- return SyncExtensionHelper::GetInstance()->InstallExtension(
- profile, CreateFakeAppName(index), Extension::TYPE_HOSTED_APP);
-}
-
-void UninstallApp(Profile* profile, int index) {
- return SyncExtensionHelper::GetInstance()->UninstallExtension(
- profile, CreateFakeAppName(index));
-}
-
-void EnableApp(Profile* profile, int index) {
- return SyncExtensionHelper::GetInstance()->EnableExtension(
- profile, CreateFakeAppName(index));
-}
-
-void DisableApp(Profile* profile, int index) {
- return SyncExtensionHelper::GetInstance()->DisableExtension(
- profile, CreateFakeAppName(index));
-}
-
-void IncognitoEnableApp(Profile* profile, int index) {
- return SyncExtensionHelper::GetInstance()->IncognitoEnableExtension(
- profile, CreateFakeAppName(index));
-}
-
-void IncognitoDisableApp(Profile* profile, int index) {
- return SyncExtensionHelper::GetInstance()->IncognitoDisableExtension(
- profile, CreateFakeAppName(index));
-}
-
-void InstallAppsPendingForSync(Profile* profile) {
- SyncExtensionHelper::GetInstance()->InstallExtensionsPendingForSync(
- profile, Extension::TYPE_HOSTED_APP);
-}
-
-} // namespace apps_helper
« no previous file with comments | « chrome/test/live_sync/apps_helper.h ('k') | chrome/test/live_sync/autofill_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698