Commit 5af135a2 authored by braffert@chromium.org's avatar braffert@chromium.org

Adding new apps/extension sync integration tests. Also modified the way that profile

extensions states are compared for equality.  Previously, the allow in incognito mode
setting was not accounted for in checking for equality.

New tests:
TwoClientLiveExtensionsSyncTest.Merge
TwoClientLiveExtensionsSyncTest.UpdateEnableDisableExtension
TwoClientLiveExtensionsSyncTest.UpdateIncognitoEnableDisable
TwoClientLiveAppsSyncTest.Merge
TwoClientLiveAppsSyncTest.UpdateEnableDisableApp
TwoClientLiveAppsSyncTest.UpdateIncognitoEnableDisable

BUG=85482
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88681 0039d316-1c4b-4281-b951-d872f2087c98
parent 44228768
...@@ -32,16 +32,9 @@ bool LiveAppsSyncTest::SetupClients() { ...@@ -32,16 +32,9 @@ bool LiveAppsSyncTest::SetupClients() {
bool LiveAppsSyncTest::HasSameAppsAsVerifier(int index) { bool LiveAppsSyncTest::HasSameAppsAsVerifier(int index) {
// TODO(akalin): We may want to filter out non-apps for some tests. // TODO(akalin): We may want to filter out non-apps for some tests.
LiveSyncExtensionHelper::ExtensionStateMap return extension_helper_.ExtensionStatesMatch(GetProfile(index), verifier());
verifier_extension_state_map(
extension_helper_.GetExtensionStates(verifier()));
LiveSyncExtensionHelper::ExtensionStateMap
extension_state_map(
extension_helper_.GetExtensionStates(GetProfile(index)));
return (extension_state_map == verifier_extension_state_map);
} }
bool LiveAppsSyncTest::AllProfilesHaveSameAppsAsVerifier() { bool LiveAppsSyncTest::AllProfilesHaveSameAppsAsVerifier() {
for (int i = 0; i < num_clients(); ++i) { for (int i = 0; i < num_clients(); ++i) {
if (!HasSameAppsAsVerifier(i)) { if (!HasSameAppsAsVerifier(i)) {
...@@ -64,6 +57,26 @@ void LiveAppsSyncTest::UninstallApp(Profile* profile, int index) { ...@@ -64,6 +57,26 @@ void LiveAppsSyncTest::UninstallApp(Profile* profile, int index) {
CreateFakeAppName(index)); 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( void LiveAppsSyncTest::InstallAppsPendingForSync(
Profile* profile) { Profile* profile) {
extension_helper_.InstallExtensionsPendingForSync( extension_helper_.InstallExtensionsPendingForSync(
......
...@@ -41,6 +41,18 @@ class LiveAppsSyncTest : public LiveSyncTest { ...@@ -41,6 +41,18 @@ class LiveAppsSyncTest : public LiveSyncTest {
// Installs all pending synced apps for |profile|. // Installs all pending synced apps for |profile|.
void InstallAppsPendingForSync(Profile* 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: private:
LiveSyncExtensionHelper extension_helper_; LiveSyncExtensionHelper extension_helper_;
......
...@@ -31,13 +31,7 @@ bool LiveExtensionsSyncTest::SetupClients() { ...@@ -31,13 +31,7 @@ bool LiveExtensionsSyncTest::SetupClients() {
} }
bool LiveExtensionsSyncTest::HasSameExtensionsAsVerifier(int index) { bool LiveExtensionsSyncTest::HasSameExtensionsAsVerifier(int index) {
LiveSyncExtensionHelper::ExtensionStateMap return extension_helper_.ExtensionStatesMatch(GetProfile(index), verifier());
verifier_extension_state_map(
extension_helper_.GetExtensionStates(verifier()));
LiveSyncExtensionHelper::ExtensionStateMap
extension_state_map(
extension_helper_.GetExtensionStates(GetProfile(index)));
return (extension_state_map == verifier_extension_state_map);
} }
bool LiveExtensionsSyncTest::AllProfilesHaveSameExtensionsAsVerifier() { bool LiveExtensionsSyncTest::AllProfilesHaveSameExtensionsAsVerifier() {
...@@ -62,6 +56,28 @@ void LiveExtensionsSyncTest::UninstallExtension(Profile* profile, int index) { ...@@ -62,6 +56,28 @@ void LiveExtensionsSyncTest::UninstallExtension(Profile* profile, int index) {
CreateFakeExtensionName(index)); CreateFakeExtensionName(index));
} }
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));
}
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));
}
void LiveExtensionsSyncTest::InstallExtensionsPendingForSync( void LiveExtensionsSyncTest::InstallExtensionsPendingForSync(
Profile* profile) { Profile* profile) {
extension_helper_.InstallExtensionsPendingForSync( extension_helper_.InstallExtensionsPendingForSync(
......
...@@ -41,6 +41,18 @@ class LiveExtensionsSyncTest : public LiveSyncTest { ...@@ -41,6 +41,18 @@ class LiveExtensionsSyncTest : public LiveSyncTest {
// Installs all pending synced extensions for |profile|. // Installs all pending synced extensions for |profile|.
void InstallExtensionsPendingForSync(Profile* 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);
// 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);
private: private:
LiveSyncExtensionHelper extension_helper_; LiveSyncExtensionHelper extension_helper_;
......
...@@ -16,6 +16,17 @@ ...@@ -16,6 +16,17 @@
#include "chrome/test/live_sync/live_sync_test.h" #include "chrome/test/live_sync/live_sync_test.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
LiveSyncExtensionHelper::ExtensionState::ExtensionState()
: enabled_state(ENABLED), incognito_enabled(false) {}
LiveSyncExtensionHelper::ExtensionState::~ExtensionState() {}
bool LiveSyncExtensionHelper::ExtensionState::Equals(
const LiveSyncExtensionHelper::ExtensionState &other) const {
return ((enabled_state == other.enabled_state) &&
(incognito_enabled == other.incognito_enabled));
}
LiveSyncExtensionHelper::LiveSyncExtensionHelper() {} LiveSyncExtensionHelper::LiveSyncExtensionHelper() {}
LiveSyncExtensionHelper::~LiveSyncExtensionHelper() {} LiveSyncExtensionHelper::~LiveSyncExtensionHelper() {}
...@@ -48,6 +59,26 @@ void LiveSyncExtensionHelper::UninstallExtension( ...@@ -48,6 +59,26 @@ void LiveSyncExtensionHelper::UninstallExtension(
NameToId(name)); NameToId(name));
} }
void LiveSyncExtensionHelper::EnableExtension(Profile* profile,
const std::string& name) {
profile->GetExtensionService()->EnableExtension(NameToId(name));
}
void LiveSyncExtensionHelper::DisableExtension(Profile* profile,
const std::string& name) {
profile->GetExtensionService()->DisableExtension(NameToId(name));
}
void LiveSyncExtensionHelper::IncognitoEnableExtension(
Profile* profile, const std::string& name) {
profile->GetExtensionService()->SetIsIncognitoEnabled(NameToId(name), true);
}
void LiveSyncExtensionHelper::IncognitoDisableExtension(
Profile* profile, const std::string& name) {
profile->GetExtensionService()->SetIsIncognitoEnabled(NameToId(name), false);
}
bool LiveSyncExtensionHelper::IsExtensionPendingInstallForSync( bool LiveSyncExtensionHelper::IsExtensionPendingInstallForSync(
Profile* profile, const std::string& id) const { Profile* profile, const std::string& id) const {
const PendingExtensionManager* pending_extension_manager = const PendingExtensionManager* pending_extension_manager =
...@@ -89,8 +120,7 @@ void LiveSyncExtensionHelper::InstallExtensionsPendingForSync( ...@@ -89,8 +120,7 @@ void LiveSyncExtensionHelper::InstallExtensionsPendingForSync(
} }
LiveSyncExtensionHelper::ExtensionStateMap LiveSyncExtensionHelper::ExtensionStateMap
LiveSyncExtensionHelper::GetExtensionStates( LiveSyncExtensionHelper::GetExtensionStates(Profile* profile) {
Profile* profile) const {
const std::string& profile_debug_name = profile->GetDebugName(); const std::string& profile_debug_name = profile->GetDebugName();
ExtensionStateMap extension_state_map; ExtensionStateMap extension_state_map;
...@@ -100,7 +130,10 @@ LiveSyncExtensionHelper::ExtensionStateMap ...@@ -100,7 +130,10 @@ LiveSyncExtensionHelper::ExtensionStateMap
const ExtensionList* extensions = extension_service->extensions(); const ExtensionList* extensions = extension_service->extensions();
for (ExtensionList::const_iterator it = extensions->begin(); for (ExtensionList::const_iterator it = extensions->begin();
it != extensions->end(); ++it) { it != extensions->end(); ++it) {
extension_state_map[(*it)->id()] = ENABLED; const std::string& id = (*it)->id();
extension_state_map[id].enabled_state = ExtensionState::ENABLED;
extension_state_map[id].incognito_enabled =
extension_service->IsIncognitoEnabled(id);
VLOG(2) << "Extension " << (*it)->id() << " in profile " VLOG(2) << "Extension " << (*it)->id() << " in profile "
<< profile_debug_name << " is enabled"; << profile_debug_name << " is enabled";
} }
...@@ -109,7 +142,10 @@ LiveSyncExtensionHelper::ExtensionStateMap ...@@ -109,7 +142,10 @@ LiveSyncExtensionHelper::ExtensionStateMap
extension_service->disabled_extensions(); extension_service->disabled_extensions();
for (ExtensionList::const_iterator it = disabled_extensions->begin(); for (ExtensionList::const_iterator it = disabled_extensions->begin();
it != disabled_extensions->end(); ++it) { it != disabled_extensions->end(); ++it) {
extension_state_map[(*it)->id()] = DISABLED; const std::string& id = (*it)->id();
extension_state_map[id].enabled_state = ExtensionState::DISABLED;
extension_state_map[id].incognito_enabled =
extension_service->IsIncognitoEnabled(id);
VLOG(2) << "Extension " << (*it)->id() << " in profile " VLOG(2) << "Extension " << (*it)->id() << " in profile "
<< profile_debug_name << " is disabled"; << profile_debug_name << " is disabled";
} }
...@@ -119,7 +155,10 @@ LiveSyncExtensionHelper::ExtensionStateMap ...@@ -119,7 +155,10 @@ LiveSyncExtensionHelper::ExtensionStateMap
PendingExtensionManager::const_iterator it; PendingExtensionManager::const_iterator it;
for (it = pending_extension_manager->begin(); for (it = pending_extension_manager->begin();
it != pending_extension_manager->end(); ++it) { it != pending_extension_manager->end(); ++it) {
extension_state_map[it->first] = PENDING; const std::string& id = it->first;
extension_state_map[id].enabled_state = ExtensionState::PENDING;
extension_state_map[id].incognito_enabled =
extension_service->IsIncognitoEnabled(id);
VLOG(2) << "Extension " << it->first << " in profile " VLOG(2) << "Extension " << it->first << " in profile "
<< profile_debug_name << " is pending"; << profile_debug_name << " is pending";
} }
...@@ -127,6 +166,34 @@ LiveSyncExtensionHelper::ExtensionStateMap ...@@ -127,6 +166,34 @@ LiveSyncExtensionHelper::ExtensionStateMap
return extension_state_map; return extension_state_map;
} }
bool LiveSyncExtensionHelper::ExtensionStatesMatch(
Profile* profile1, Profile* profile2) {
const ExtensionStateMap& state_map1 = GetExtensionStates(profile1);
const ExtensionStateMap& state_map2 = GetExtensionStates(profile2);
if (state_map1.size() != state_map2.size()) {
VLOG(1) << "Number of extensions for profile " << profile1->GetDebugName()
<< " does not match profile " << profile2->GetDebugName();
return false;
}
ExtensionStateMap::const_iterator it1 = state_map1.begin();
ExtensionStateMap::const_iterator it2 = state_map2.begin();
while (it1 != state_map1.end()) {
if (it1->first != it2->first) {
VLOG(1) << "Extensions for profile " << profile1->GetDebugName()
<< " do not match profile " << profile2->GetDebugName();
return false;
} else if (!it1->second.Equals(it2->second)) {
VLOG(1) << "Extension states for profile " << profile1->GetDebugName()
<< " do not match profile " << profile2->GetDebugName();
return false;
}
++it1;
++it2;
}
return true;
}
void LiveSyncExtensionHelper::SetupProfile(Profile* profile) { void LiveSyncExtensionHelper::SetupProfile(Profile* profile) {
profile->InitExtensions(true); profile->InitExtensions(true);
profile_extensions_.insert(make_pair(profile, ExtensionNameMap())); profile_extensions_.insert(make_pair(profile, ExtensionNameMap()));
......
...@@ -20,10 +20,6 @@ class Profile; ...@@ -20,10 +20,6 @@ class Profile;
class LiveSyncExtensionHelper { class LiveSyncExtensionHelper {
public: public:
enum ExtensionState { DISABLED, PENDING, ENABLED };
typedef std::map<std::string, ExtensionState> ExtensionStateMap;
LiveSyncExtensionHelper(); LiveSyncExtensionHelper();
~LiveSyncExtensionHelper(); ~LiveSyncExtensionHelper();
...@@ -41,6 +37,18 @@ class LiveSyncExtensionHelper { ...@@ -41,6 +37,18 @@ class LiveSyncExtensionHelper {
// Uninstalls the extension with the given name from |profile|. // Uninstalls the extension with the given name from |profile|.
void UninstallExtension(Profile* profile, const std::string& name); 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 // Returns true iff the extension with the given id is pending
// install in |profile|. // install in |profile|.
bool IsExtensionPendingInstallForSync( bool IsExtensionPendingInstallForSync(
...@@ -50,15 +58,30 @@ class LiveSyncExtensionHelper { ...@@ -50,15 +58,30 @@ class LiveSyncExtensionHelper {
// type. // type.
void InstallExtensionsPendingForSync(Profile* profile, Extension::Type type); void InstallExtensionsPendingForSync(Profile* profile, Extension::Type type);
// Returns a map from |profile|'s installed extensions to their // Returns true iff |profile1| and |profile2| have the same extensions and
// state. // they are all in the same state.
ExtensionStateMap GetExtensionStates(Profile* profile) const; static bool ExtensionStatesMatch(Profile* profile1, Profile* profile2);
private: 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<std::string, scoped_refptr<Extension> > ExtensionNameMap;
typedef std::map<Profile*, ExtensionNameMap> ProfileExtensionNameMap; typedef std::map<Profile*, ExtensionNameMap> ProfileExtensionNameMap;
typedef std::map<std::string, std::string> StringMap; 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 // Initializes extensions for |profile| and creates an entry in
// |profile_extensions_| for it. // |profile_extensions_| for it.
void SetupProfile(Profile* profile); void SetupProfile(Profile* profile);
......
...@@ -147,6 +147,89 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, Uninstall) { ...@@ -147,6 +147,89 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, Uninstall) {
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
} }
// TCM ID - 3699295.
IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, Merge) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
InstallApp(GetProfile(0), 0);
InstallApp(GetProfile(1), 0);
ASSERT_TRUE(AwaitQuiescence());
UninstallApp(GetProfile(0), 0);
InstallApp(GetProfile(0), 1);
InstallApp(verifier(), 1);
InstallApp(GetProfile(0), 2);
InstallApp(GetProfile(1), 2);
InstallApp(verifier(), 2);
InstallApp(GetProfile(1), 3);
InstallApp(verifier(), 3);
ASSERT_TRUE(AwaitQuiescence());
InstallAppsPendingForSync(GetProfile(0));
InstallAppsPendingForSync(GetProfile(1));
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
}
// TCM ID - 7723126.
IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, UpdateEnableDisableApp) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
InstallApp(GetProfile(0), 0);
InstallApp(GetProfile(1), 0);
InstallApp(verifier(), 0);
ASSERT_TRUE(AwaitQuiescence());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
DisableApp(GetProfile(0), 0);
DisableApp(verifier(), 0);
ASSERT_TRUE(HasSameAppsAsVerifier(0));
ASSERT_FALSE(HasSameAppsAsVerifier(1));
ASSERT_TRUE(AwaitQuiescence());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
EnableApp(GetProfile(1), 0);
EnableApp(verifier(), 0);
ASSERT_TRUE(HasSameAppsAsVerifier(1));
ASSERT_FALSE(HasSameAppsAsVerifier(0));
ASSERT_TRUE(AwaitQuiescence());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
}
// TCM ID - 7706637.
IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest,
UpdateIncognitoEnableDisable) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
InstallApp(GetProfile(0), 0);
InstallApp(GetProfile(1), 0);
InstallApp(verifier(), 0);
ASSERT_TRUE(AwaitQuiescence());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
IncognitoEnableApp(GetProfile(0), 0);
IncognitoEnableApp(verifier(), 0);
ASSERT_TRUE(HasSameAppsAsVerifier(0));
ASSERT_FALSE(HasSameAppsAsVerifier(1));
ASSERT_TRUE(AwaitQuiescence());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
IncognitoDisableApp(GetProfile(1), 0);
IncognitoDisableApp(verifier(), 0);
ASSERT_TRUE(HasSameAppsAsVerifier(1));
ASSERT_FALSE(HasSameAppsAsVerifier(0));
ASSERT_TRUE(AwaitQuiescence());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
}
// TCM ID - 3718276. // TCM ID - 3718276.
IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, DisableApps) { IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, DisableApps) {
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
......
...@@ -147,6 +147,90 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest, Uninstall) { ...@@ -147,6 +147,90 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest, Uninstall) {
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
} }
// TCM ID - 3635304.
IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest, Merge) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
InstallExtension(GetProfile(0), 0);
InstallExtension(GetProfile(1), 0);
ASSERT_TRUE(AwaitQuiescence());
UninstallExtension(GetProfile(0), 0);
InstallExtension(GetProfile(0), 1);
InstallExtension(verifier(), 1);
InstallExtension(GetProfile(0), 2);
InstallExtension(GetProfile(1), 2);
InstallExtension(verifier(), 2);
InstallExtension(GetProfile(1), 3);
InstallExtension(verifier(), 3);
ASSERT_TRUE(AwaitQuiescence());
InstallExtensionsPendingForSync(GetProfile(0));
InstallExtensionsPendingForSync(GetProfile(1));
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
}
// TCM ID - 3605300.
IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest,
UpdateEnableDisableExtension) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
InstallExtension(GetProfile(0), 0);
InstallExtension(GetProfile(1), 0);
InstallExtension(verifier(), 0);
ASSERT_TRUE(AwaitQuiescence());
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
DisableExtension(GetProfile(0), 0);
DisableExtension(verifier(), 0);
ASSERT_TRUE(HasSameExtensionsAsVerifier(0));
ASSERT_FALSE(HasSameExtensionsAsVerifier(1));
ASSERT_TRUE(AwaitQuiescence());
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
EnableExtension(GetProfile(1), 0);
EnableExtension(verifier(), 0);
ASSERT_TRUE(HasSameExtensionsAsVerifier(1));
ASSERT_FALSE(HasSameExtensionsAsVerifier(0));
ASSERT_TRUE(AwaitQuiescence());
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
}
// TCM ID - 3728322.
IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest,
UpdateIncognitoEnableDisable) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
InstallExtension(GetProfile(0), 0);
InstallExtension(GetProfile(1), 0);
InstallExtension(verifier(), 0);
ASSERT_TRUE(AwaitQuiescence());
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
IncognitoEnableExtension(GetProfile(0), 0);
IncognitoEnableExtension(verifier(), 0);
ASSERT_TRUE(HasSameExtensionsAsVerifier(0));
ASSERT_FALSE(HasSameExtensionsAsVerifier(1));
ASSERT_TRUE(AwaitQuiescence());
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
IncognitoDisableExtension(GetProfile(1), 0);
IncognitoDisableExtension(verifier(), 0);
ASSERT_TRUE(HasSameExtensionsAsVerifier(1));
ASSERT_FALSE(HasSameExtensionsAsVerifier(0));
ASSERT_TRUE(AwaitQuiescence());
ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier());
}
// TCM ID - 3732278. // TCM ID - 3732278.
IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest, DisableExtensions) { IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest, DisableExtensions) {
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
......
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