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

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

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/live_extensions_sync_test.cc
diff --git a/chrome/test/live_sync/live_extensions_sync_test.cc b/chrome/test/live_sync/live_extensions_sync_test.cc
deleted file mode 100644
index c1fe399480b77be358a59da6423162118979c766..0000000000000000000000000000000000000000
--- a/chrome/test/live_sync/live_extensions_sync_test.cc
+++ /dev/null
@@ -1,135 +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/live_extensions_sync_test.h"
-
-#include <cstring>
-
-#include "base/logging.h"
-#include "base/string_number_conversions.h"
-#include "base/string_util.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/common/extensions/extension.h"
-
-const char extension_name_prefix[] = "fakeextension";
-
-LiveExtensionsSyncTest::LiveExtensionsSyncTest(TestType test_type)
- : LiveSyncTest(test_type) {}
-
-LiveExtensionsSyncTest::~LiveExtensionsSyncTest() {}
-
-bool LiveExtensionsSyncTest::SetupClients() {
- if (!LiveSyncTest::SetupClients())
- return false;
-
- extension_helper_.Setup(this);
- return true;
-}
-
-bool LiveExtensionsSyncTest::HasSameExtensionsAsVerifier(int index) {
- return extension_helper_.ExtensionStatesMatch(GetProfile(index), verifier());
-}
-
-bool LiveExtensionsSyncTest::AllProfilesHaveSameExtensionsAsVerifier() {
- for (int i = 0; i < num_clients(); ++i) {
- if (!HasSameExtensionsAsVerifier(i)) {
- LOG(ERROR) << "Profile " << i << " doesn't have the same extensions as"
- " the verifier profile.";
- return false;
- }
- }
- return true;
-}
-
-bool LiveExtensionsSyncTest::AllProfilesHaveSameExtensions() {
- for (int i = 1; i < num_clients(); ++i) {
- if (!extension_helper_.ExtensionStatesMatch(GetProfile(0),
- GetProfile(i))) {
- LOG(ERROR) << "Profile " << i << " doesnt have the same extensions as"
- " profile 0.";
- return false;
- }
- }
- return true;
-}
-
-
-void LiveExtensionsSyncTest::InstallExtension(Profile* profile, int index) {
- return extension_helper_.InstallExtension(profile,
- CreateFakeExtensionName(index),
- Extension::TYPE_EXTENSION);
-}
-
-void LiveExtensionsSyncTest::UninstallExtension(Profile* profile, int index) {
- return extension_helper_.UninstallExtension(profile,
- CreateFakeExtensionName(index));
-}
-
-std::vector<int> LiveExtensionsSyncTest::GetInstalledExtensions(
- Profile* profile) {
- std::vector<int> indices;
- std::vector<std::string> names =
- extension_helper_.GetInstalledExtensionNames(profile);
- for (std::vector<std::string>::const_iterator it = names.begin();
- it != names.end(); ++it) {
- int index;
- if (ExtensionNameToIndex(*it, &index)) {
- indices.push_back(index);
- }
- }
- return indices;
-}
-
-void LiveExtensionsSyncTest::EnableExtension(Profile* profile, int index) {
- return extension_helper_.EnableExtension(profile,
- CreateFakeExtensionName(index));
-}
-
-void LiveExtensionsSyncTest::DisableExtension(Profile* profile, int index) {
- return extension_helper_.DisableExtension(profile,
- CreateFakeExtensionName(index));
-}
-
-bool LiveExtensionsSyncTest::IsExtensionEnabled(Profile* profile, int index) {
- return extension_helper_.IsExtensionEnabled(profile,
- CreateFakeExtensionName(index));
-}
-
-void LiveExtensionsSyncTest::IncognitoEnableExtension(Profile* profile,
- int index) {
- return extension_helper_.IncognitoEnableExtension(
- profile, CreateFakeExtensionName(index));
-}
-
-void LiveExtensionsSyncTest::IncognitoDisableExtension(Profile* profile,
- int index) {
- return extension_helper_.IncognitoDisableExtension(
- profile, CreateFakeExtensionName(index));
-}
-
-bool LiveExtensionsSyncTest::IsIncognitoEnabled(Profile* profile, int index) {
- return extension_helper_.IsIncognitoEnabled(profile,
- CreateFakeExtensionName(index));
-}
-
-void LiveExtensionsSyncTest::InstallExtensionsPendingForSync(
- Profile* profile) {
- extension_helper_.InstallExtensionsPendingForSync(
- profile, Extension::TYPE_EXTENSION);
-}
-
-std::string LiveExtensionsSyncTest::CreateFakeExtensionName(int index) {
- return extension_name_prefix + base::IntToString(index);
-}
-
-bool LiveExtensionsSyncTest::ExtensionNameToIndex(const std::string& name,
- int* index) {
- if (!StartsWithASCII(name, extension_name_prefix, true) ||
- !base::StringToInt(name.substr(strlen(extension_name_prefix)), index)) {
- LOG(WARNING) << "Unable to convert extension name \"" << name
- << "\" to index";
- return false;
- }
- return true;
-}
« no previous file with comments | « chrome/test/live_sync/live_extensions_sync_test.h ('k') | chrome/test/live_sync/live_sync_extension_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698