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

Unified Diff: chrome/browser/sync/test/integration/apps_helper.cc

Issue 1851243002: [Sync] Eliminate verifier profile from sync_integration_tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: do not remove AwaitQuiescence() Created 4 years, 9 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/browser/sync/test/integration/apps_helper.cc
diff --git a/chrome/browser/sync/test/integration/apps_helper.cc b/chrome/browser/sync/test/integration/apps_helper.cc
index 2b76b4d893f1a08c1eb0db477edf4cceb5feff38..435694010dc5fd827d937c75dda078e6ce643a5c 100644
--- a/chrome/browser/sync/test/integration/apps_helper.cc
+++ b/chrome/browser/sync/test/integration/apps_helper.cc
@@ -35,16 +35,16 @@ std::string CreateFakeAppName(int index) {
namespace apps_helper {
-bool HasSameAppsAsVerifier(int index) {
- return SyncAppHelper::GetInstance()->AppStatesMatch(
- test()->GetProfile(index), test()->verifier());
+bool HasSameApps(Profile* profile1, Profile* profile2) {
+ return SyncAppHelper::GetInstance()->AppStatesMatch(profile1, profile2);
}
-bool AllProfilesHaveSameAppsAsVerifier() {
- for (int i = 0; i < test()->num_clients(); ++i) {
- if (!HasSameAppsAsVerifier(i)) {
- DVLOG(1) << "Profile " << i << " doesn't have the same apps as the"
- " verifier profile.";
+bool AllProfilesHaveSameApps() {
+ const auto& profiles = test()->GetAllProfiles();
+ for (auto* profile : profiles) {
+ if (profile != profiles.front() &&
+ !HasSameApps(profiles.front(), profile)) {
+ DVLOG(1) << "Profiles apps do not match.";
return false;
}
}
@@ -66,9 +66,11 @@ std::string InstallPlatformApp(Profile* profile, int index) {
}
std::string InstallAppForAllProfiles(int index) {
- for (int i = 0; i < test()->num_clients(); ++i)
- InstallApp(test()->GetProfile(i), index);
- return InstallApp(test()->verifier(), index);
+ std::string extension_id;
+ for (auto* profile : test()->GetAllProfiles()) {
+ extension_id = InstallApp(profile, index);
+ }
+ return extension_id;
}
void UninstallApp(Profile* profile, int index) {
@@ -86,6 +88,11 @@ void DisableApp(Profile* profile, int index) {
profile, CreateFakeAppName(index));
}
+bool IsAppEnabled(Profile* profile, int index) {
+ return SyncExtensionHelper::GetInstance()->IsExtensionEnabled(
+ profile, CreateFakeAppName(index));
+}
+
void IncognitoEnableApp(Profile* profile, int index) {
return SyncExtensionHelper::GetInstance()->IncognitoEnableExtension(
profile, CreateFakeAppName(index));
@@ -96,6 +103,11 @@ void IncognitoDisableApp(Profile* profile, int index) {
profile, CreateFakeAppName(index));
}
+bool IsIncognitoEnabled(Profile* profile, int index) {
+ return SyncExtensionHelper::GetInstance()->IsIncognitoEnabled(
+ profile, CreateFakeAppName(index));
+}
+
void InstallAppsPendingForSync(Profile* profile) {
SyncExtensionHelper::GetInstance()->InstallExtensionsPendingForSync(profile);
}
« no previous file with comments | « chrome/browser/sync/test/integration/apps_helper.h ('k') | chrome/browser/sync/test/integration/autofill_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698