Commit 70e1bef9 authored by rsimha@chromium.org's avatar rsimha@chromium.org

Allow sync integration tests to operate on multiple datatypes: Apps, Extensions, Themes

The sync integration tests currently use a class hierarchy where the test classes for each datatype are subclasses of LiveSyncTest. While this design worked in the past, it allows tests to work with only one datatype at a time, and therefore doesn't allow us to test the interplay between datatypes.

This patch is another in the series of patches that will move away from an inheritance model to one where test cases can operate on more than one datatype. It updates the Apps, Extensions and Themes datatypes to the new model, and contains the following changes:

- LiveAppsSyncTest is no longer a class that inherits from LiveSyncTest, but is now a namespace called apps_helper, and contains a bunch of methods that perform various operations related to Apps. Similar changes were made to Extensions and Themes.
- SingleClientLiveAppsSyncTest is renamed to SingleClientAppsSyncTest, and is a subclass of LiveSyncTest. It uses the methods in namespace apps_helper by including its header file and attaching itself to the helper. Similar changes were made to Extensions and Themes.
- LiveSyncExtensionHelper is renamed to SyncExtensionHelper.

BUG=88510
TEST=sync_integration_tests, sync_performance_tests

Review URL: http://codereview.chromium.org/7599019

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96292 0039d316-1c4b-4281-b951-d872f2087c98
parent 42828a33
......@@ -3287,22 +3287,18 @@
'test/base/test_notification_tracker.cc',
'test/base/test_notification_tracker.h',
'test/data/resource.rc',
'test/live_sync/apps_helper.cc',
'test/live_sync/apps_helper.h',
'test/live_sync/autofill_helper.cc',
'test/live_sync/autofill_helper.h',
'test/live_sync/bookmarks_helper.cc',
'test/live_sync/bookmarks_helper.h',
'test/live_sync/live_apps_sync_test.cc',
'test/live_sync/live_apps_sync_test.h',
'test/live_sync/live_extensions_sync_test.cc',
'test/live_sync/live_extensions_sync_test.h',
'test/live_sync/extensions_helper.cc',
'test/live_sync/extensions_helper.h',
'test/live_sync/live_passwords_sync_test.cc',
'test/live_sync/live_passwords_sync_test.h',
'test/live_sync/live_sessions_sync_test.cc',
'test/live_sync/live_sessions_sync_test.h',
'test/live_sync/live_themes_sync_test.cc',
'test/live_sync/live_themes_sync_test.h',
'test/live_sync/live_sync_extension_helper.cc',
'test/live_sync/live_sync_extension_helper.h',
'test/live_sync/live_sync_test.cc',
'test/live_sync/live_sync_test.h',
'test/live_sync/many_client_bookmarks_sync_test.cc',
......@@ -3316,25 +3312,29 @@
'test/live_sync/multiple_client_typed_urls_sync_test.cc',
'test/live_sync/preferences_helper.cc',
'test/live_sync/preferences_helper.h',
'test/live_sync/single_client_apps_sync_test.cc',
'test/live_sync/single_client_bookmarks_sync_test.cc',
'test/live_sync/single_client_live_apps_sync_test.cc',
'test/live_sync/single_client_live_extensions_sync_test.cc',
'test/live_sync/single_client_extensions_sync_test.cc',
'test/live_sync/single_client_live_passwords_sync_test.cc',
'test/live_sync/single_client_live_sessions_sync_test.cc',
'test/live_sync/single_client_live_themes_sync_test.cc',
'test/live_sync/single_client_preferences_sync_test.cc',
'test/live_sync/single_client_themes_sync_test.cc',
'test/live_sync/single_client_typed_urls_sync_test.cc',
'test/live_sync/sync_datatype_helper.cc',
'test/live_sync/sync_datatype_helper.h',
'test/live_sync/sync_errors_test.cc',
'test/live_sync/sync_extension_helper.cc',
'test/live_sync/sync_extension_helper.h',
'test/live_sync/themes_helper.cc',
'test/live_sync/themes_helper.h',
'test/live_sync/two_client_apps_sync_test.cc',
'test/live_sync/two_client_autofill_sync_test.cc',
'test/live_sync/two_client_bookmarks_sync_test.cc',
'test/live_sync/two_client_live_apps_sync_test.cc',
'test/live_sync/two_client_live_extensions_sync_test.cc',
'test/live_sync/two_client_extensions_sync_test.cc',
'test/live_sync/two_client_live_passwords_sync_test.cc',
'test/live_sync/two_client_live_sessions_sync_test.cc',
'test/live_sync/two_client_live_themes_sync_test.cc',
'test/live_sync/two_client_preferences_sync_test.cc',
'test/live_sync/two_client_themes_sync_test.cc',
'test/live_sync/two_client_typed_urls_sync_test.cc',
'test/live_sync/typed_urls_helper.cc',
'test/live_sync/typed_urls_helper.h',
......@@ -3437,14 +3437,12 @@
'test/live_sync/autofill_helper.h',
'test/live_sync/bookmarks_helper.cc',
'test/live_sync/bookmarks_helper.h',
'test/live_sync/live_extensions_sync_test.cc',
'test/live_sync/live_extensions_sync_test.h',
'test/live_sync/extensions_helper.cc',
'test/live_sync/extensions_helper.h',
'test/live_sync/live_passwords_sync_test.cc',
'test/live_sync/live_passwords_sync_test.h',
'test/live_sync/live_sessions_sync_test.cc',
'test/live_sync/live_sessions_sync_test.h',
'test/live_sync/live_sync_extension_helper.cc',
'test/live_sync/live_sync_extension_helper.h',
'test/live_sync/live_sync_test.cc',
'test/live_sync/live_sync_test.h',
'test/live_sync/performance/autofill_sync_perf_test.cc',
......@@ -3457,6 +3455,8 @@
'test/live_sync/performance/typed_urls_sync_perf_test.cc',
'test/live_sync/sync_datatype_helper.cc',
'test/live_sync/sync_datatype_helper.h',
'test/live_sync/sync_extension_helper.cc',
'test/live_sync/sync_extension_helper.h',
'test/live_sync/typed_urls_helper.cc',
'test/live_sync/typed_urls_helper.h',
],
......
// 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
// 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.
#ifndef CHROME_TEST_LIVE_SYNC_APPS_HELPER_H_
#define CHROME_TEST_LIVE_SYNC_APPS_HELPER_H_
#pragma once
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "chrome/test/live_sync/live_sync_test.h"
class Profile;
namespace apps_helper {
// Returns true iff the profile with index |index| has the same apps as the
// verifier.
bool HasSameAppsAsVerifier(int index) WARN_UNUSED_RESULT;
// Returns true iff all existing profiles have the same apps as the verifier.
bool AllProfilesHaveSameAppsAsVerifier() WARN_UNUSED_RESULT;
// Installs the app for the given index to |profile|.
void InstallApp(Profile* profile, int index);
// Uninstalls the app for the given index from |profile|. Assumes that it was
// previously installed.
void UninstallApp(Profile* profile, int index);
// Installs all pending synced apps for |profile|.
void InstallAppsPendingForSync(Profile* profile);
// Enables the app for the given index on |profile|.
void EnableApp(Profile* profile, int index);
// Disables the appfor the given index on |profile|.
void DisableApp(Profile* profile, int index);
// Enables the app for the given index in incognito mode on |profile|.
void IncognitoEnableApp(Profile* profile, int index);
// Disables the app for the given index in incognito mode on |profile|.
void IncognitoDisableApp(Profile* profile, int index);
} // namespace apps_helper
#endif // CHROME_TEST_LIVE_SYNC_APPS_HELPER_H_
......@@ -2,7 +2,7 @@
// 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 "chrome/test/live_sync/extensions_helper.h"
#include <cstring>
......@@ -11,28 +11,22 @@
#include "base/string_util.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"
const char extension_name_prefix[] = "fakeextension";
LiveExtensionsSyncTest::LiveExtensionsSyncTest(TestType test_type)
: LiveSyncTest(test_type) {}
using sync_datatype_helper::test;
LiveExtensionsSyncTest::~LiveExtensionsSyncTest() {}
bool LiveExtensionsSyncTest::SetupClients() {
if (!LiveSyncTest::SetupClients())
return false;
namespace extensions_helper {
extension_helper_.Setup(this);
return true;
}
const char extension_name_prefix[] = "fakeextension";
bool LiveExtensionsSyncTest::HasSameExtensionsAsVerifier(int index) {
return extension_helper_.ExtensionStatesMatch(GetProfile(index), verifier());
bool HasSameExtensionsAsVerifier(int index) {
return SyncExtensionHelper::GetInstance()->ExtensionStatesMatch(
test()->GetProfile(index), test()->verifier());
}
bool LiveExtensionsSyncTest::AllProfilesHaveSameExtensionsAsVerifier() {
for (int i = 0; i < num_clients(); ++i) {
bool AllProfilesHaveSameExtensionsAsVerifier() {
for (int i = 0; i < test()->num_clients(); ++i) {
if (!HasSameExtensionsAsVerifier(i)) {
LOG(ERROR) << "Profile " << i << " doesn't have the same extensions as"
" the verifier profile.";
......@@ -42,10 +36,10 @@ bool LiveExtensionsSyncTest::AllProfilesHaveSameExtensionsAsVerifier() {
return true;
}
bool LiveExtensionsSyncTest::AllProfilesHaveSameExtensions() {
for (int i = 1; i < num_clients(); ++i) {
if (!extension_helper_.ExtensionStatesMatch(GetProfile(0),
GetProfile(i))) {
bool AllProfilesHaveSameExtensions() {
for (int i = 1; i < test()->num_clients(); ++i) {
if (!SyncExtensionHelper::GetInstance()->ExtensionStatesMatch(
test()->GetProfile(0), test()->GetProfile(i))) {
LOG(ERROR) << "Profile " << i << " doesnt have the same extensions as"
" profile 0.";
return false;
......@@ -55,22 +49,20 @@ bool LiveExtensionsSyncTest::AllProfilesHaveSameExtensions() {
}
void LiveExtensionsSyncTest::InstallExtension(Profile* profile, int index) {
return extension_helper_.InstallExtension(profile,
CreateFakeExtensionName(index),
Extension::TYPE_EXTENSION);
void InstallExtension(Profile* profile, int index) {
return SyncExtensionHelper::GetInstance()->InstallExtension(
profile, CreateFakeExtensionName(index), Extension::TYPE_EXTENSION);
}
void LiveExtensionsSyncTest::UninstallExtension(Profile* profile, int index) {
return extension_helper_.UninstallExtension(profile,
CreateFakeExtensionName(index));
void UninstallExtension(Profile* profile, int index) {
return SyncExtensionHelper::GetInstance()->UninstallExtension(
profile, CreateFakeExtensionName(index));
}
std::vector<int> LiveExtensionsSyncTest::GetInstalledExtensions(
Profile* profile) {
std::vector<int> GetInstalledExtensions(Profile* profile) {
std::vector<int> indices;
std::vector<std::string> names =
extension_helper_.GetInstalledExtensionNames(profile);
SyncExtensionHelper::GetInstance()->GetInstalledExtensionNames(profile);
for (std::vector<std::string>::const_iterator it = names.begin();
it != names.end(); ++it) {
int index;
......@@ -81,50 +73,46 @@ std::vector<int> LiveExtensionsSyncTest::GetInstalledExtensions(
return indices;
}
void LiveExtensionsSyncTest::EnableExtension(Profile* profile, int index) {
return extension_helper_.EnableExtension(profile,
CreateFakeExtensionName(index));
void EnableExtension(Profile* profile, int index) {
return SyncExtensionHelper::GetInstance()->EnableExtension(
profile, CreateFakeExtensionName(index));
}
void LiveExtensionsSyncTest::DisableExtension(Profile* profile, int index) {
return extension_helper_.DisableExtension(profile,
CreateFakeExtensionName(index));
void DisableExtension(Profile* profile, int index) {
return SyncExtensionHelper::GetInstance()->DisableExtension(
profile, CreateFakeExtensionName(index));
}
bool LiveExtensionsSyncTest::IsExtensionEnabled(Profile* profile, int index) {
return extension_helper_.IsExtensionEnabled(profile,
CreateFakeExtensionName(index));
bool IsExtensionEnabled(Profile* profile, int index) {
return SyncExtensionHelper::GetInstance()->IsExtensionEnabled(
profile, CreateFakeExtensionName(index));
}
void LiveExtensionsSyncTest::IncognitoEnableExtension(Profile* profile,
int index) {
return extension_helper_.IncognitoEnableExtension(
void IncognitoEnableExtension(Profile* profile, int index) {
return SyncExtensionHelper::GetInstance()->IncognitoEnableExtension(
profile, CreateFakeExtensionName(index));
}
void LiveExtensionsSyncTest::IncognitoDisableExtension(Profile* profile,
int index) {
return extension_helper_.IncognitoDisableExtension(
void IncognitoDisableExtension(Profile* profile, int index) {
return SyncExtensionHelper::GetInstance()->IncognitoDisableExtension(
profile, CreateFakeExtensionName(index));
}
bool LiveExtensionsSyncTest::IsIncognitoEnabled(Profile* profile, int index) {
return extension_helper_.IsIncognitoEnabled(profile,
CreateFakeExtensionName(index));
bool IsIncognitoEnabled(Profile* profile, int index) {
return SyncExtensionHelper::GetInstance()->IsIncognitoEnabled(
profile, CreateFakeExtensionName(index));
}
void LiveExtensionsSyncTest::InstallExtensionsPendingForSync(
Profile* profile) {
extension_helper_.InstallExtensionsPendingForSync(
void InstallExtensionsPendingForSync(Profile* profile) {
SyncExtensionHelper::GetInstance()->InstallExtensionsPendingForSync(
profile, Extension::TYPE_EXTENSION);
}
std::string LiveExtensionsSyncTest::CreateFakeExtensionName(int index) {
std::string CreateFakeExtensionName(int index) {
return extension_name_prefix + base::IntToString(index);
}
bool LiveExtensionsSyncTest::ExtensionNameToIndex(const std::string& name,
int* index) {
bool 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
......@@ -133,3 +121,5 @@ bool LiveExtensionsSyncTest::ExtensionNameToIndex(const std::string& name,
}
return true;
}
} // namespace extensions_helper
// 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.
#ifndef CHROME_TEST_LIVE_SYNC_EXTENSIONS_HELPER_H_
#define CHROME_TEST_LIVE_SYNC_EXTENSIONS_HELPER_H_
#pragma once
#include <string>
#include <vector>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "chrome/test/live_sync/live_sync_test.h"
class Profile;
namespace extensions_helper {
// Returns true iff the profile with index |index| has the same extensions
// as the verifier.
bool HasSameExtensionsAsVerifier(int index) WARN_UNUSED_RESULT;
// Returns true iff all existing profiles have the same extensions
// as the verifier.
bool AllProfilesHaveSameExtensionsAsVerifier() WARN_UNUSED_RESULT;
// Returns true iff all existing profiles have the same extensions.
bool AllProfilesHaveSameExtensions() WARN_UNUSED_RESULT;
// Installs the extension for the given index to |profile|.
void InstallExtension(Profile* profile, int index);
// Uninstalls the extension for the given index from |profile|. Assumes that
// it was previously installed.
void UninstallExtension(Profile* profile, int index);
// Returns a vector containing the indices of all currently installed
// test extensions on |profile|.
std::vector<int> GetInstalledExtensions(Profile* profile);
// Installs all pending synced extensions for |profile|.
void InstallExtensionsPendingForSync(Profile* profile);
// Enables the extension for the given index on |profile|.
void EnableExtension(Profile* profile, int index);
// Disables the extension for the given index on |profile|.
void DisableExtension(Profile* profile, int index);
// Returns true if the extension with index |index| is enabled on |profile|.
bool IsExtensionEnabled(Profile* profile, int index);
// Enables the extension for the given index in incognito mode on |profile|.
void IncognitoEnableExtension(Profile* profile, int index);
// Disables the extension for the given index in incognito mode on |profile|.
void IncognitoDisableExtension(Profile* profile, int index);
// Returns true if the extension with index |index| is enabled in incognito
// mode on |profile|.
bool IsIncognitoEnabled(Profile* profile, int index);
// Returns a unique extension name based in the integer |index|.
std::string CreateFakeExtensionName(int index);
// Converts a fake extension name back into the index used to generate it.
// Returns true if successful, false on failure.
bool ExtensionNameToIndex(const std::string& name, int* index);
} // namespace extensions_helper
#endif // CHROME_TEST_LIVE_SYNC_EXTENSIONS_HELPER_H_
// 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_apps_sync_test.h"
#include "base/logging.h"
#include "base/string_number_conversions.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/extension.h"
namespace {
std::string CreateFakeAppName(int index) {
return "fakeapp" + base::IntToString(index);
}
} // namespace
LiveAppsSyncTest::LiveAppsSyncTest(TestType test_type)
: LiveSyncTest(test_type) {}
LiveAppsSyncTest::~LiveAppsSyncTest() {}
bool LiveAppsSyncTest::SetupClients() {
if (!LiveSyncTest::SetupClients())
return false;
extension_helper_.Setup(this);
return true;
}
bool LiveAppsSyncTest::HasSameAppsAsVerifier(int index) {
// TODO(akalin): We may want to filter out non-apps for some tests.
return extension_helper_.ExtensionStatesMatch(GetProfile(index), verifier());
}
bool LiveAppsSyncTest::AllProfilesHaveSameAppsAsVerifier() {
for (int i = 0; i < 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 LiveAppsSyncTest::InstallApp(Profile* profile, int index) {
return extension_helper_.InstallExtension(profile,
CreateFakeAppName(index),
Extension::TYPE_HOSTED_APP);
}
void LiveAppsSyncTest::UninstallApp(Profile* profile, int index) {
return extension_helper_.UninstallExtension(profile,
CreateFakeAppName(index));
}
void LiveAppsSyncTest::EnableApp(Profile* profile, int index) {
return extension_helper_.EnableExtension(profile,
CreateFakeAppName(index));
}
void LiveAppsSyncTest::DisableApp(Profile* profile, int index) {
return extension_helper_.DisableExtension(profile,
CreateFakeAppName(index));
}
void LiveAppsSyncTest::IncognitoEnableApp(Profile* profile, int index) {
return extension_helper_.IncognitoEnableExtension(profile,
CreateFakeAppName(index));
}
void LiveAppsSyncTest::IncognitoDisableApp(Profile* profile, int index) {
return extension_helper_.IncognitoDisableExtension(profile,
CreateFakeAppName(index));
}
void LiveAppsSyncTest::InstallAppsPendingForSync(
Profile* profile) {
extension_helper_.InstallExtensionsPendingForSync(
profile, Extension::TYPE_HOSTED_APP);
}
// 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.
#ifndef CHROME_TEST_LIVE_SYNC_LIVE_APPS_SYNC_TEST_H_
#define CHROME_TEST_LIVE_SYNC_LIVE_APPS_SYNC_TEST_H_
#pragma once
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "chrome/test/live_sync/live_sync_extension_helper.h"
#include "chrome/test/live_sync/live_sync_test.h"
class Profile;
class LiveAppsSyncTest : public LiveSyncTest {
public:
explicit LiveAppsSyncTest(TestType test_type);
virtual ~LiveAppsSyncTest();
protected:
// Like LiveSyncTest::SetupClients(), but also sets up
// |extension_helper_|.
virtual bool SetupClients() OVERRIDE WARN_UNUSED_RESULT;
// Returns true iff the profile with index |index| has the same apps as the
// verifier.
bool HasSameAppsAsVerifier(int index) WARN_UNUSED_RESULT;
// Returns true iff all existing profiles have the same apps as the
// verifier.
bool AllProfilesHaveSameAppsAsVerifier() WARN_UNUSED_RESULT;
// Installs the app for the given index to |profile|.
void InstallApp(Profile* profile, int index);
// Uninstalls the app for the given index from |profile|. Assumes that it was
// previously installed.
void UninstallApp(Profile* profile, int index);
// Installs all pending synced apps for |profile|.
void InstallAppsPendingForSync(Profile* profile);
// Enables the app for the given index on |profile|.
void EnableApp(Profile* profile, int index);
// Disables the appfor the given index on |profile|.
void DisableApp(Profile* profile, int index);
// Enables the app for the given index in incognito mode on |profile|.
void IncognitoEnableApp(Profile* profile, int index);
// Disables the app for the given index in incognito mode on |profile|.
void IncognitoDisableApp(Profile* profile, int index);
private:
LiveSyncExtensionHelper extension_helper_;
DISALLOW_COPY_AND_ASSIGN(LiveAppsSyncTest);
};
#endif // CHROME_TEST_LIVE_SYNC_LIVE_APPS_SYNC_TEST_H_
// 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.
#ifndef CHROME_TEST_LIVE_SYNC_LIVE_EXTENSIONS_SYNC_TEST_H_
#define CHROME_TEST_LIVE_SYNC_LIVE_EXTENSIONS_SYNC_TEST_H_
#pragma once
#include <string>
#include <vector>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "chrome/test/live_sync/live_sync_extension_helper.h"
#include "chrome/test/live_sync/live_sync_test.h"
class Profile;
class LiveExtensionsSyncTest : public LiveSyncTest {
public:
explicit LiveExtensionsSyncTest(TestType test_type);
virtual ~LiveExtensionsSyncTest();
protected:
// Like LiveSyncTest::SetupClients(), but also sets up
// |extension_helper_|.
virtual bool SetupClients() OVERRIDE WARN_UNUSED_RESULT;
// Returns true iff the profile with index |index| has the same extensions
// as the verifier.
bool HasSameExtensionsAsVerifier(int index) WARN_UNUSED_RESULT;
// Returns true iff all existing profiles have the same extensions
// as the verifier.
bool AllProfilesHaveSameExtensionsAsVerifier() WARN_UNUSED_RESULT;
// Returns true iff all existing profiles have the same extensions.
bool AllProfilesHaveSameExtensions() WARN_UNUSED_RESULT;
// Installs the extension for the given index to |profile|.
void InstallExtension(Profile* profile, int index);
// Uninstalls the extension for the given index from |profile|. Assumes that
// it was previously installed.
void UninstallExtension(Profile* profile, int index);
// Returns a vector containing the indices of all currently installed
// test extensions on |profile|.
std::vector<int> GetInstalledExtensions(Profile* profile);
// Installs all pending synced extensions for |profile|.
void InstallExtensionsPendingForSync(Profile* profile);
// Enables the extension for the given index on |profile|.
void EnableExtension(Profile* profile, int index);
// Disables the extension for the given index on |profile|.
void DisableExtension(Profile* profile, int index);
// Returns true if the extension with index |index| is enabled on |profile|.
bool IsExtensionEnabled(Profile* profile, int index);
// Enables the extension for the given index in incognito mode on |profile|.
void IncognitoEnableExtension(Profile* profile, int index);
// Disables the extension for the given index in incognito mode on |profile|.
void IncognitoDisableExtension(Profile* profile, int index);
// Returns true if the extension with index |index| is enabled in incognito
// mode on |profile|.
bool IsIncognitoEnabled(Profile* profile, int index);
// Returns a unique extension name based in the integer |index|.
static std::string CreateFakeExtensionName(int index);
// Converts a fake extension name back into the index used to generate it.
// Returns true if successful, false on failure.
static bool ExtensionNameToIndex(const std::string& name, int* index);
private:
LiveSyncExtensionHelper extension_helper_;
DISALLOW_COPY_AND_ASSIGN(LiveExtensionsSyncTest);
};
class SingleClientLiveExtensionsSyncTest : public LiveExtensionsSyncTest {
public:
SingleClientLiveExtensionsSyncTest()
: LiveExtensionsSyncTest(SINGLE_CLIENT) {}
virtual ~SingleClientLiveExtensionsSyncTest() {}
private:
DISALLOW_COPY_AND_ASSIGN(SingleClientLiveExtensionsSyncTest);
};
class TwoClientLiveExtensionsSyncTest : public LiveExtensionsSyncTest {
public:
TwoClientLiveExtensionsSyncTest()
: LiveExtensionsSyncTest(TWO_CLIENT) {}
virtual ~TwoClientLiveExtensionsSyncTest() {}
private:
DISALLOW_COPY_AND_ASSIGN(TwoClientLiveExtensionsSyncTest);
};
#endif // CHROME_TEST_LIVE_SYNC_LIVE_EXTENSIONS_SYNC_TEST_H_
// 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.
#ifndef CHROME_TEST_LIVE_SYNC_LIVE_THEMES_SYNC_TEST_H_
#define CHROME_TEST_LIVE_SYNC_LIVE_THEMES_SYNC_TEST_H_
#pragma once
#include <string>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "chrome/test/live_sync/live_sync_extension_helper.h"
#include "chrome/test/live_sync/live_sync_test.h"
class Profile;
class LiveThemesSyncTest : public LiveSyncTest {
public:
explicit LiveThemesSyncTest(TestType test_type);
virtual ~LiveThemesSyncTest();
protected:
// Like LiveSyncTest::SetupClients(), but also sets up
// |extension_helper_|.
virtual bool SetupClients() OVERRIDE WARN_UNUSED_RESULT;
// Gets the unique ID of the custom theme with the given index.
std::string GetCustomTheme(int index) const WARN_UNUSED_RESULT;
// Gets the ID of |profile|'s theme.
std::string GetThemeID(Profile* profile) const WARN_UNUSED_RESULT;
// Returns true iff |profile| is using a custom theme.
bool UsingCustomTheme(Profile* profile) const WARN_UNUSED_RESULT;
// Returns true iff |profile| is using the default theme.
bool UsingDefaultTheme(Profile* profile) const WARN_UNUSED_RESULT;
// Returns true iff |profile| is using the native theme.
bool UsingNativeTheme(Profile* profile) const WARN_UNUSED_RESULT;
// Returns true iff a theme with the given ID is pending install in
// |profile|.
bool ThemeIsPendingInstall(
Profile* profile, const std::string& id) const WARN_UNUSED_RESULT;
// Returns true iff |profile|'s current theme is the given
// custom theme or if the given theme is pending install.
bool HasOrWillHaveCustomTheme(
Profile* profile, const std::string& id) const WARN_UNUSED_RESULT;
// Sets |profile| to use the custom theme with the given index.
void UseCustomTheme(Profile* profile, int index);
// Sets |profile| to use the default theme.
void UseDefaultTheme(Profile* profile);
// Sets |profile| to use the native theme.
void UseNativeTheme(Profile* profile);
private:
LiveSyncExtensionHelper extension_helper_;
DISALLOW_COPY_AND_ASSIGN(LiveThemesSyncTest);
};
#endif // CHROME_TEST_LIVE_SYNC_LIVE_THEMES_SYNC_TEST_H_
......@@ -4,9 +4,20 @@
#include "base/stringprintf.h"
#include "chrome/browser/sync/profile_sync_service_harness.h"
#include "chrome/test/live_sync/live_extensions_sync_test.h"
#include "chrome/test/live_sync/extensions_helper.h"
#include "chrome/test/live_sync/live_sync_test.h"
#include "chrome/test/live_sync/performance/sync_timing_helper.h"
using extensions_helper::AllProfilesHaveSameExtensions;
using extensions_helper::AllProfilesHaveSameExtensionsAsVerifier;
using extensions_helper::DisableExtension;
using extensions_helper::EnableExtension;
using extensions_helper::GetInstalledExtensions;
using extensions_helper::InstallExtension;
using extensions_helper::InstallExtensionsPendingForSync;
using extensions_helper::IsExtensionEnabled;
using extensions_helper::UninstallExtension;
// TODO(braffert): Replicate these tests for apps.
// TODO(braffert): Move kNumBenchmarkPoints and kBenchmarkPoints for all
......@@ -17,9 +28,11 @@ static const int kBenchmarkPoints[] = {1, 10, 20, 30, 40, 50, 75, 100, 125,
150, 175, 200, 225, 250, 300, 350, 400,
500};
class ExtensionsSyncPerfTest : public TwoClientLiveExtensionsSyncTest {
class ExtensionsSyncPerfTest : public LiveSyncTest {
public:
ExtensionsSyncPerfTest() : extension_number_(0) {}
ExtensionsSyncPerfTest()
: LiveSyncTest(TWO_CLIENT),
extension_number_(0) {}
// Adds |num_extensions| new unique extensions to |profile|.
void AddExtensions(int profile, int num_extensions);
......@@ -42,8 +55,7 @@ class ExtensionsSyncPerfTest : public TwoClientLiveExtensionsSyncTest {
DISALLOW_COPY_AND_ASSIGN(ExtensionsSyncPerfTest);
};
void ExtensionsSyncPerfTest::AddExtensions(int profile,
int num_extensions) {
void ExtensionsSyncPerfTest::AddExtensions(int profile, int num_extensions) {
for (int i = 0; i < num_extensions; ++i) {
InstallExtension(GetProfile(profile), extension_number_++);
}
......
......@@ -4,28 +4,29 @@
#include "base/basictypes.h"
#include "chrome/browser/sync/profile_sync_service_harness.h"
#include "chrome/test/live_sync/live_apps_sync_test.h"
#include "chrome/test/live_sync/apps_helper.h"
#include "chrome/test/live_sync/live_sync_test.h"
class SingleClientLiveAppsSyncTest : public LiveAppsSyncTest {
using apps_helper::AllProfilesHaveSameAppsAsVerifier;
using apps_helper::InstallApp;
class SingleClientAppsSyncTest : public LiveSyncTest {
public:
SingleClientLiveAppsSyncTest()
: LiveAppsSyncTest(SINGLE_CLIENT) {}
SingleClientAppsSyncTest() : LiveSyncTest(SINGLE_CLIENT) {}
virtual ~SingleClientLiveAppsSyncTest() {}
virtual ~SingleClientAppsSyncTest() {}
private:
DISALLOW_COPY_AND_ASSIGN(SingleClientLiveAppsSyncTest);
DISALLOW_COPY_AND_ASSIGN(SingleClientAppsSyncTest);
};
IN_PROC_BROWSER_TEST_F(SingleClientLiveAppsSyncTest,
StartWithNoApps) {
IN_PROC_BROWSER_TEST_F(SingleClientAppsSyncTest, StartWithNoApps) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
}
IN_PROC_BROWSER_TEST_F(SingleClientLiveAppsSyncTest,
StartWithSomeApps) {
IN_PROC_BROWSER_TEST_F(SingleClientAppsSyncTest, StartWithSomeApps) {
ASSERT_TRUE(SetupClients());
const int kNumApps = 5;
......@@ -39,8 +40,7 @@ IN_PROC_BROWSER_TEST_F(SingleClientLiveAppsSyncTest,
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
}
IN_PROC_BROWSER_TEST_F(SingleClientLiveAppsSyncTest,
InstallSomeApps) {
IN_PROC_BROWSER_TEST_F(SingleClientAppsSyncTest, InstallSomeApps) {
ASSERT_TRUE(SetupSync());
const int kNumApps = 5;
......
......@@ -4,16 +4,29 @@
#include "base/basictypes.h"
#include "chrome/browser/sync/profile_sync_service_harness.h"
#include "chrome/test/live_sync/live_extensions_sync_test.h"
#include "chrome/test/live_sync/extensions_helper.h"
#include "chrome/test/live_sync/live_sync_test.h"
IN_PROC_BROWSER_TEST_F(SingleClientLiveExtensionsSyncTest,
StartWithNoExtensions) {
using extensions_helper::AllProfilesHaveSameExtensionsAsVerifier;
using extensions_helper::InstallExtension;
class SingleClientExtensionsSyncTest : public LiveSyncTest {
public:
SingleClientExtensionsSyncTest() : LiveSyncTest(SINGLE_CLIENT) {}
virtual ~SingleClientExtensionsSyncTest() {}
private:
DISALLOW_COPY_AND_ASSIGN(SingleClientExtensionsSyncTest);
};
IN_PROC_BROWSER_TEST_F(SingleClientExtensionsSyncTest, StartWithNoExtensions) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
}
IN_PROC_BROWSER_TEST_F(SingleClientLiveExtensionsSyncTest,
IN_PROC_BROWSER_TEST_F(SingleClientExtensionsSyncTest,
StartWithSomeExtensions) {
ASSERT_TRUE(SetupClients());
......@@ -28,8 +41,7 @@ IN_PROC_BROWSER_TEST_F(SingleClientLiveExtensionsSyncTest,
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
}
IN_PROC_BROWSER_TEST_F(SingleClientLiveExtensionsSyncTest,
InstallSomeExtensions) {
IN_PROC_BROWSER_TEST_F(SingleClientExtensionsSyncTest, InstallSomeExtensions) {
ASSERT_TRUE(SetupSync());
const int kNumExtensions = 5;
......
......@@ -4,22 +4,32 @@
#include "base/basictypes.h"
#include "chrome/browser/sync/profile_sync_service_harness.h"
#include "chrome/test/live_sync/live_themes_sync_test.h"
class SingleClientLiveThemesSyncTest : public LiveThemesSyncTest {
#include "chrome/test/live_sync/themes_helper.h"
#include "chrome/test/live_sync/live_sync_test.h"
using themes_helper::GetCustomTheme;
using themes_helper::GetThemeID;
using themes_helper::UseCustomTheme;
using themes_helper::UseDefaultTheme;
using themes_helper::UseNativeTheme;
using themes_helper::UsingCustomTheme;
using themes_helper::UsingDefaultTheme;
using themes_helper::UsingNativeTheme;
class SingleClientThemesSyncTest : public LiveSyncTest {
public:
SingleClientLiveThemesSyncTest() : LiveThemesSyncTest(SINGLE_CLIENT) {}
virtual ~SingleClientLiveThemesSyncTest() {}
SingleClientThemesSyncTest() : LiveSyncTest(SINGLE_CLIENT) {}
virtual ~SingleClientThemesSyncTest() {}
private:
DISALLOW_COPY_AND_ASSIGN(SingleClientLiveThemesSyncTest);
DISALLOW_COPY_AND_ASSIGN(SingleClientThemesSyncTest);
};
// TODO(akalin): Add tests for model association (i.e., tests that
// start with SetupClients(), change the theme state, then call
// SetupSync()).
IN_PROC_BROWSER_TEST_F(SingleClientLiveThemesSyncTest, CustomTheme) {
IN_PROC_BROWSER_TEST_F(SingleClientThemesSyncTest, CustomTheme) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
ASSERT_FALSE(UsingCustomTheme(GetProfile(0)));
......@@ -39,9 +49,9 @@ IN_PROC_BROWSER_TEST_F(SingleClientLiveThemesSyncTest, CustomTheme) {
// TODO(sync): Fails on Chrome OS. See http://crbug.com/84575.
#if defined(OS_CHROMEOS)
IN_PROC_BROWSER_TEST_F(SingleClientLiveThemesSyncTest, FAILS_NativeTheme) {
IN_PROC_BROWSER_TEST_F(SingleClientThemesSyncTest, FAILS_NativeTheme) {
#else
IN_PROC_BROWSER_TEST_F(SingleClientLiveThemesSyncTest, NativeTheme) {
IN_PROC_BROWSER_TEST_F(SingleClientThemesSyncTest, NativeTheme) {
#endif // OS_CHROMEOS
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
......@@ -65,7 +75,7 @@ IN_PROC_BROWSER_TEST_F(SingleClientLiveThemesSyncTest, NativeTheme) {
ASSERT_TRUE(UsingNativeTheme(verifier()));
}
IN_PROC_BROWSER_TEST_F(SingleClientLiveThemesSyncTest, DefaultTheme) {
IN_PROC_BROWSER_TEST_F(SingleClientThemesSyncTest, DefaultTheme) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
UseCustomTheme(GetProfile(0), 0);
......
......@@ -2,7 +2,7 @@
// 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_sync_extension_helper.h"
#include "chrome/test/live_sync/sync_extension_helper.h"
#include "base/file_path.h"
#include "base/file_util.h"
......@@ -14,38 +14,51 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/test/live_sync/live_sync_test.h"
#include "chrome/test/live_sync/sync_datatype_helper.h"
#include "testing/gtest/include/gtest/gtest.h"
LiveSyncExtensionHelper::ExtensionState::ExtensionState()
SyncExtensionHelper::ExtensionState::ExtensionState()
: enabled_state(ENABLED), incognito_enabled(false) {}
LiveSyncExtensionHelper::ExtensionState::~ExtensionState() {}
SyncExtensionHelper::ExtensionState::~ExtensionState() {}
bool LiveSyncExtensionHelper::ExtensionState::Equals(
const LiveSyncExtensionHelper::ExtensionState &other) const {
bool SyncExtensionHelper::ExtensionState::Equals(
const SyncExtensionHelper::ExtensionState &other) const {
return ((enabled_state == other.enabled_state) &&
(incognito_enabled == other.incognito_enabled));
}
LiveSyncExtensionHelper::LiveSyncExtensionHelper() {}
// static
SyncExtensionHelper* SyncExtensionHelper::GetInstance() {
SyncExtensionHelper* instance = Singleton<SyncExtensionHelper>::get();
instance->SetupIfNecessary(sync_datatype_helper::test());
return instance;
}
SyncExtensionHelper::SyncExtensionHelper() : setup_completed_(false) {}
LiveSyncExtensionHelper::~LiveSyncExtensionHelper() {}
SyncExtensionHelper::~SyncExtensionHelper() {}
// static
std::string LiveSyncExtensionHelper::NameToId(const std::string& name) {
std::string SyncExtensionHelper::NameToId(const std::string& name) {
std::string id;
EXPECT_TRUE(Extension::GenerateId(name, &id));
return id;
}
void LiveSyncExtensionHelper::Setup(LiveSyncTest* test) {
void SyncExtensionHelper::SetupIfNecessary(LiveSyncTest* test) {
if (setup_completed_)
return;
for (int i = 0; i < test->num_clients(); ++i) {
SetupProfile(test->GetProfile(i));
}
SetupProfile(test->verifier());
setup_completed_ = true;
}
void LiveSyncExtensionHelper::InstallExtension(
void SyncExtensionHelper::InstallExtension(
Profile* profile, const std::string& name, Extension::Type type) {
scoped_refptr<Extension> extension = GetExtension(profile, name, type);
ASSERT_TRUE(extension.get()) << "Could not get extension " << name
......@@ -54,13 +67,13 @@ void LiveSyncExtensionHelper::InstallExtension(
extension, extension->UpdatesFromGallery());
}
void LiveSyncExtensionHelper::UninstallExtension(
void SyncExtensionHelper::UninstallExtension(
Profile* profile, const std::string& name) {
ExtensionService::UninstallExtensionHelper(profile->GetExtensionService(),
NameToId(name));
}
std::vector<std::string> LiveSyncExtensionHelper::GetInstalledExtensionNames(
std::vector<std::string> SyncExtensionHelper::GetInstalledExtensionNames(
Profile* profile) const {
std::vector<std::string> names;
ExtensionService* extension_service = profile->GetExtensionService();
......@@ -88,38 +101,38 @@ std::vector<std::string> LiveSyncExtensionHelper::GetInstalledExtensionNames(
return names;
}
void LiveSyncExtensionHelper::EnableExtension(Profile* profile,
const std::string& name) {
void SyncExtensionHelper::EnableExtension(Profile* profile,
const std::string& name) {
profile->GetExtensionService()->EnableExtension(NameToId(name));
}
void LiveSyncExtensionHelper::DisableExtension(Profile* profile,
const std::string& name) {
void SyncExtensionHelper::DisableExtension(Profile* profile,
const std::string& name) {
profile->GetExtensionService()->DisableExtension(NameToId(name));
}
bool LiveSyncExtensionHelper::IsExtensionEnabled(
bool SyncExtensionHelper::IsExtensionEnabled(
Profile* profile, const std::string& name) const {
return profile->GetExtensionService()->IsExtensionEnabled(NameToId(name));
}
void LiveSyncExtensionHelper::IncognitoEnableExtension(
void SyncExtensionHelper::IncognitoEnableExtension(
Profile* profile, const std::string& name) {
profile->GetExtensionService()->SetIsIncognitoEnabled(NameToId(name), true);
}
void LiveSyncExtensionHelper::IncognitoDisableExtension(
void SyncExtensionHelper::IncognitoDisableExtension(
Profile* profile, const std::string& name) {
profile->GetExtensionService()->SetIsIncognitoEnabled(NameToId(name), false);
}
bool LiveSyncExtensionHelper::IsIncognitoEnabled(
bool SyncExtensionHelper::IsIncognitoEnabled(
Profile* profile, const std::string& name) const {
return profile->GetExtensionService()->IsIncognitoEnabled(NameToId(name));
}
bool LiveSyncExtensionHelper::IsExtensionPendingInstallForSync(
bool SyncExtensionHelper::IsExtensionPendingInstallForSync(
Profile* profile, const std::string& id) const {
const PendingExtensionManager* pending_extension_manager =
profile->GetExtensionService()->pending_extension_manager();
......@@ -130,7 +143,7 @@ bool LiveSyncExtensionHelper::IsExtensionPendingInstallForSync(
return info.is_from_sync();
}
void LiveSyncExtensionHelper::InstallExtensionsPendingForSync(
void SyncExtensionHelper::InstallExtensionsPendingForSync(
Profile* profile, Extension::Type type) {
// TODO(akalin): Mock out the servers that the extensions auto-update
// mechanism talk to so as to more closely match what actually happens.
......@@ -159,8 +172,8 @@ void LiveSyncExtensionHelper::InstallExtensionsPendingForSync(
}
}
LiveSyncExtensionHelper::ExtensionStateMap
LiveSyncExtensionHelper::GetExtensionStates(Profile* profile) {
SyncExtensionHelper::ExtensionStateMap
SyncExtensionHelper::GetExtensionStates(Profile* profile) {
const std::string& profile_debug_name = profile->GetDebugName();
ExtensionStateMap extension_state_map;
......@@ -206,7 +219,7 @@ LiveSyncExtensionHelper::ExtensionStateMap
return extension_state_map;
}
bool LiveSyncExtensionHelper::ExtensionStatesMatch(
bool SyncExtensionHelper::ExtensionStatesMatch(
Profile* profile1, Profile* profile2) {
const ExtensionStateMap& state_map1 = GetExtensionStates(profile1);
const ExtensionStateMap& state_map2 = GetExtensionStates(profile2);
......@@ -234,7 +247,7 @@ bool LiveSyncExtensionHelper::ExtensionStatesMatch(
return true;
}
void LiveSyncExtensionHelper::SetupProfile(Profile* profile) {
void SyncExtensionHelper::SetupProfile(Profile* profile) {
profile->InitExtensions(true);
profile_extensions_.insert(make_pair(profile, ExtensionNameMap()));
}
......@@ -311,7 +324,7 @@ scoped_refptr<Extension> CreateExtension(
} // namespace
scoped_refptr<Extension> LiveSyncExtensionHelper::GetExtension(
scoped_refptr<Extension> SyncExtensionHelper::GetExtension(
Profile* profile, const std::string& name,
Extension::Type type) {
if (name.empty()) {
......
......@@ -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_
......@@ -2,13 +2,17 @@
// 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_themes_sync_test.h"
#include "chrome/test/live_sync/themes_helper.h"
#include "base/logging.h"
#include "base/string_number_conversions.h"
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.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 {
......@@ -23,59 +27,49 @@ ThemeService* GetThemeService(Profile* profile) {
} // namespace
LiveThemesSyncTest::LiveThemesSyncTest(TestType test_type)
: LiveSyncTest(test_type) {}
LiveThemesSyncTest::~LiveThemesSyncTest() {}
bool LiveThemesSyncTest::SetupClients() {
if (!LiveSyncTest::SetupClients())
return false;
namespace themes_helper {
extension_helper_.Setup(this);
return true;
std::string GetCustomTheme(int index) {
return SyncExtensionHelper::GetInstance()->NameToId(MakeName(index));
}
std::string LiveThemesSyncTest::GetCustomTheme(int index) const {
return extension_helper_.NameToId(MakeName(index));
}
std::string LiveThemesSyncTest::GetThemeID(Profile* profile) const {
std::string GetThemeID(Profile* profile) {
return GetThemeService(profile)->GetThemeID();
}
bool LiveThemesSyncTest::UsingCustomTheme(Profile* profile) const {
bool UsingCustomTheme(Profile* profile) {
return GetThemeID(profile) != ThemeService::kDefaultThemeID;
}
bool LiveThemesSyncTest::UsingDefaultTheme(Profile* profile) const {
bool UsingDefaultTheme(Profile* profile) {
return GetThemeService(profile)->UsingDefaultTheme();
}
bool LiveThemesSyncTest::UsingNativeTheme(Profile* profile) const {
bool UsingNativeTheme(Profile* profile) {
return GetThemeService(profile)->UsingNativeTheme();
}
bool LiveThemesSyncTest::ThemeIsPendingInstall(
Profile* profile, const std::string& id) const {
return extension_helper_.IsExtensionPendingInstallForSync(profile, id);
bool ThemeIsPendingInstall(Profile* profile, const std::string& id) {
return SyncExtensionHelper::GetInstance()->
IsExtensionPendingInstallForSync(profile, id);
}
bool LiveThemesSyncTest::HasOrWillHaveCustomTheme(
Profile* profile, const std::string& id) const {
bool HasOrWillHaveCustomTheme(Profile* profile, const std::string& id) {
return (GetThemeID(profile) == id) || ThemeIsPendingInstall(profile, id);
}
void LiveThemesSyncTest::UseCustomTheme(Profile* profile, int index) {
extension_helper_.InstallExtension(
void UseCustomTheme(Profile* profile, int index) {
SyncExtensionHelper::GetInstance()->InstallExtension(
profile, MakeName(index), Extension::TYPE_THEME);
}
void LiveThemesSyncTest::UseDefaultTheme(Profile* profile) {
void UseDefaultTheme(Profile* profile) {
GetThemeService(profile)->UseDefaultTheme();
}
void LiveThemesSyncTest::UseNativeTheme(Profile* profile) {
void UseNativeTheme(Profile* profile) {
// TODO(akalin): Fix this inconsistent naming in the theme service.
GetThemeService(profile)->SetNativeTheme();
}
} // namespace themes_helper
// 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.
#ifndef CHROME_TEST_LIVE_SYNC_THEMES_HELPER_H_
#define CHROME_TEST_LIVE_SYNC_THEMES_HELPER_H_
#pragma once
#include <string>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "chrome/test/live_sync/live_sync_test.h"
class Profile;
namespace themes_helper {
// Gets the unique ID of the custom theme with the given index.
std::string GetCustomTheme(int index) WARN_UNUSED_RESULT;
// Gets the ID of |profile|'s theme.
std::string GetThemeID(Profile* profile) WARN_UNUSED_RESULT;
// Returns true iff |profile| is using a custom theme.
bool UsingCustomTheme(Profile* profile) WARN_UNUSED_RESULT;
// Returns true iff |profile| is using the default theme.
bool UsingDefaultTheme(Profile* profile) WARN_UNUSED_RESULT;
// Returns true iff |profile| is using the native theme.
bool UsingNativeTheme(Profile* profile) WARN_UNUSED_RESULT;
// Returns true iff a theme with the given ID is pending install in
// |profile|.
bool ThemeIsPendingInstall(
Profile* profile, const std::string& id) WARN_UNUSED_RESULT;
// Returns true iff |profile|'s current theme is the given
// custom theme or if the given theme is pending install.
bool HasOrWillHaveCustomTheme(
Profile* profile, const std::string& id) WARN_UNUSED_RESULT;
// Sets |profile| to use the custom theme with the given index.
void UseCustomTheme(Profile* profile, int index);
// Sets |profile| to use the default theme.
void UseDefaultTheme(Profile* profile);
// Sets |profile| to use the native theme.
void UseNativeTheme(Profile* profile);
} // namespace themes_helper
#endif // CHROME_TEST_LIVE_SYNC_THEMES_HELPER_H_
......@@ -4,28 +4,36 @@
#include "base/basictypes.h"
#include "chrome/browser/sync/profile_sync_service_harness.h"
#include "chrome/test/live_sync/live_apps_sync_test.h"
class TwoClientLiveAppsSyncTest : public LiveAppsSyncTest {
#include "chrome/test/live_sync/apps_helper.h"
#include "chrome/test/live_sync/live_sync_test.h"
using apps_helper::AllProfilesHaveSameAppsAsVerifier;
using apps_helper::DisableApp;
using apps_helper::EnableApp;
using apps_helper::HasSameAppsAsVerifier;
using apps_helper::IncognitoDisableApp;
using apps_helper::IncognitoEnableApp;
using apps_helper::InstallApp;
using apps_helper::InstallAppsPendingForSync;
using apps_helper::UninstallApp;
class TwoClientAppsSyncTest : public LiveSyncTest {
public:
TwoClientLiveAppsSyncTest()
: LiveAppsSyncTest(TWO_CLIENT) {}
TwoClientAppsSyncTest() : LiveSyncTest(TWO_CLIENT) {}
virtual ~TwoClientLiveAppsSyncTest() {}
virtual ~TwoClientAppsSyncTest() {}
private:
DISALLOW_COPY_AND_ASSIGN(TwoClientLiveAppsSyncTest);
DISALLOW_COPY_AND_ASSIGN(TwoClientAppsSyncTest);
};
IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest,
StartWithNoApps) {
IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, StartWithNoApps) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
}
IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest,
StartWithSameApps) {
IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, StartWithSameApps) {
ASSERT_TRUE(SetupClients());
const int kNumApps = 5;
......@@ -42,8 +50,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest,
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
}
IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest,
StartWithDifferentApps) {
IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, StartWithDifferentApps) {
ASSERT_TRUE(SetupClients());
int i = 0;
......@@ -77,8 +84,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest,
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
}
IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest,
InstallDifferentApps) {
IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, InstallDifferentApps) {
ASSERT_TRUE(SetupClients());
int i = 0;
......@@ -115,7 +121,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest,
}
// TCM ID - 3711279.
IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, Add) {
IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, Add) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
......@@ -129,7 +135,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, Add) {
}
// TCM ID - 3706267.
IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, Uninstall) {
IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, Uninstall) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
......@@ -148,7 +154,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, Uninstall) {
}
// TCM ID - 3699295.
IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, Merge) {
IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, Merge) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
......@@ -174,7 +180,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, Merge) {
}
// TCM ID - 7723126.
IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, UpdateEnableDisableApp) {
IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, UpdateEnableDisableApp) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
......@@ -202,8 +208,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, UpdateEnableDisableApp) {
}
// TCM ID - 7706637.
IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest,
UpdateIncognitoEnableDisable) {
IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, UpdateIncognitoEnableDisable) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
......@@ -231,7 +236,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest,
}
// TCM ID - 3718276.
IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, DisableApps) {
IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, DisableApps) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
......@@ -251,7 +256,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, DisableApps) {
}
// TCM ID - 3720303.
IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, DisableSync) {
IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, DisableSync) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
......
......@@ -4,17 +4,36 @@
#include "base/basictypes.h"
#include "chrome/browser/sync/profile_sync_service_harness.h"
#include "chrome/test/live_sync/live_extensions_sync_test.h"
IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest,
StartWithNoExtensions) {
#include "chrome/test/live_sync/extensions_helper.h"
#include "chrome/test/live_sync/live_sync_test.h"
using extensions_helper::AllProfilesHaveSameExtensionsAsVerifier;
using extensions_helper::DisableExtension;
using extensions_helper::EnableExtension;
using extensions_helper::HasSameExtensionsAsVerifier;
using extensions_helper::IncognitoDisableExtension;
using extensions_helper::IncognitoEnableExtension;
using extensions_helper::InstallExtension;
using extensions_helper::InstallExtensionsPendingForSync;
using extensions_helper::UninstallExtension;
class TwoClientExtensionsSyncTest : public LiveSyncTest {
public:
TwoClientExtensionsSyncTest() : LiveSyncTest(TWO_CLIENT) {}
virtual ~TwoClientExtensionsSyncTest() {}
private:
DISALLOW_COPY_AND_ASSIGN(TwoClientExtensionsSyncTest);
};
IN_PROC_BROWSER_TEST_F(TwoClientExtensionsSyncTest, StartWithNoExtensions) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
}
IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest,
StartWithSameExtensions) {
IN_PROC_BROWSER_TEST_F(TwoClientExtensionsSyncTest, StartWithSameExtensions) {
ASSERT_TRUE(SetupClients());
const int kNumExtensions = 5;
......@@ -31,7 +50,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest,
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
}
IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest,
IN_PROC_BROWSER_TEST_F(TwoClientExtensionsSyncTest,
StartWithDifferentExtensions) {
ASSERT_TRUE(SetupClients());
......@@ -66,7 +85,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest,
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
}
IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest,
IN_PROC_BROWSER_TEST_F(TwoClientExtensionsSyncTest,
InstallDifferentExtensions) {
ASSERT_TRUE(SetupClients());
......@@ -104,7 +123,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest,
}
// TCM ID - 3637311.
IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest, Add) {
IN_PROC_BROWSER_TEST_F(TwoClientExtensionsSyncTest, Add) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
......@@ -118,7 +137,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest, Add) {
}
// TCM ID - 3724281.
IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest, Uninstall) {
IN_PROC_BROWSER_TEST_F(TwoClientExtensionsSyncTest, Uninstall) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
......@@ -137,7 +156,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest, Uninstall) {
}
// TCM ID - 3635304.
IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest, Merge) {
IN_PROC_BROWSER_TEST_F(TwoClientExtensionsSyncTest, Merge) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
......@@ -163,7 +182,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest, Merge) {
}
// TCM ID - 3605300.
IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest,
IN_PROC_BROWSER_TEST_F(TwoClientExtensionsSyncTest,
UpdateEnableDisableExtension) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
......@@ -192,7 +211,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest,
}
// TCM ID - 3728322.
IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest,
IN_PROC_BROWSER_TEST_F(TwoClientExtensionsSyncTest,
UpdateIncognitoEnableDisable) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
......@@ -221,7 +240,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest,
}
// TCM ID - 3732278.
IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest, DisableExtensions) {
IN_PROC_BROWSER_TEST_F(TwoClientExtensionsSyncTest, DisableExtensions) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
......@@ -240,7 +259,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest, DisableExtensions) {
}
// TCM ID - 3606290.
IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest, DisableSync) {
IN_PROC_BROWSER_TEST_F(TwoClientExtensionsSyncTest, DisableSync) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
......
......@@ -4,15 +4,27 @@
#include "base/basictypes.h"
#include "chrome/browser/sync/profile_sync_service_harness.h"
#include "chrome/test/live_sync/live_themes_sync_test.h"
class TwoClientLiveThemesSyncTest : public LiveThemesSyncTest {
#include "chrome/test/live_sync/themes_helper.h"
#include "chrome/test/live_sync/live_sync_test.h"
using themes_helper::GetCustomTheme;
using themes_helper::GetThemeID;
using themes_helper::HasOrWillHaveCustomTheme;
using themes_helper::ThemeIsPendingInstall;
using themes_helper::UseCustomTheme;
using themes_helper::UseDefaultTheme;
using themes_helper::UseNativeTheme;
using themes_helper::UsingCustomTheme;
using themes_helper::UsingDefaultTheme;
using themes_helper::UsingNativeTheme;
class TwoClientThemesSyncTest : public LiveSyncTest {
public:
TwoClientLiveThemesSyncTest() : LiveThemesSyncTest(TWO_CLIENT) {}
virtual ~TwoClientLiveThemesSyncTest() {}
TwoClientThemesSyncTest() : LiveSyncTest(TWO_CLIENT) {}
virtual ~TwoClientThemesSyncTest() {}
private:
DISALLOW_COPY_AND_ASSIGN(TwoClientLiveThemesSyncTest);
DISALLOW_COPY_AND_ASSIGN(TwoClientThemesSyncTest);
};
// TODO(akalin): Add tests for model association (i.e., tests that
......@@ -20,7 +32,7 @@ class TwoClientLiveThemesSyncTest : public LiveThemesSyncTest {
// SetupSync()).
// TCM ID - 3667311.
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomTheme) {
IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, CustomTheme) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
ASSERT_FALSE(UsingCustomTheme(GetProfile(0)));
......@@ -46,9 +58,9 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomTheme) {
// TCM ID - 3599303.
// TODO(sync): Fails on Chrome OS. See http://crbug.com/84575.
#if defined(OS_CHROMEOS)
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, FAILS_NativeTheme) {
IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, FAILS_NativeTheme) {
#else
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, NativeTheme) {
IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, NativeTheme) {
#endif // OS_CHROMEOS
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
......@@ -71,7 +83,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, NativeTheme) {
}
// TCM ID - 7247455.
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, DefaultTheme) {
IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, DefaultTheme) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
UseCustomTheme(GetProfile(0), 0);
......@@ -95,9 +107,9 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, DefaultTheme) {
// TCM ID - 7292065.
// TODO(sync): Fails on Chrome OS. See http://crbug.com/84575.
#if defined(OS_CHROMEOS)
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, FAILS_NativeDefaultRace) {
IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, FAILS_NativeDefaultRace) {
#else
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, NativeDefaultRace) {
IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, NativeDefaultRace) {
#endif // OS_CHROMEOS
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
......@@ -120,9 +132,9 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, NativeDefaultRace) {
// TCM ID - 7294077.
// TODO(sync): Fails on Chrome OS. See http://crbug.com/84575.
#if defined(OS_CHROMEOS)
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, FAILS_CustomNativeRace) {
IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, FAILS_CustomNativeRace) {
#else
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomNativeRace) {
IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, CustomNativeRace) {
#endif // OS_CHROMEOS
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
......@@ -141,7 +153,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomNativeRace) {
}
// TCM ID - 7307225.
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomDefaultRace) {
IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, CustomDefaultRace) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
UseCustomTheme(GetProfile(0), 0);
......@@ -156,7 +168,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomDefaultRace) {
}
// TCM ID - 7264758.
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomCustomRace) {
IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, CustomCustomRace) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
// TODO(akalin): Generalize this to n clients.
......@@ -180,7 +192,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomCustomRace) {
}
// TCM ID - 3723272.
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, DisableThemes) {
IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, DisableThemes) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
ASSERT_FALSE(UsingCustomTheme(GetProfile(0)));
......@@ -206,7 +218,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, DisableThemes) {
}
// TCM ID - 3687288.
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, DisableSync) {
IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, DisableSync) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
ASSERT_FALSE(UsingCustomTheme(GetProfile(0)));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment