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

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

Issue 2740363002: [Sync] Fix EnableDisableSingleClientTest (Closed)
Patch Set: add {} Created 3 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
« no previous file with comments | « chrome/browser/sync/test/integration/sync_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/test/integration/two_client_arc_package_sync_test.cc
diff --git a/chrome/browser/sync/test/integration/two_client_arc_package_sync_test.cc b/chrome/browser/sync/test/integration/two_client_arc_package_sync_test.cc
index cb4bfa3ce4909041420fc4dc58b02f23f580bb3a..b1f24690581da45e02063e531910e7b301dbad66 100644
--- a/chrome/browser/sync/test/integration/two_client_arc_package_sync_test.cc
+++ b/chrome/browser/sync/test/integration/two_client_arc_package_sync_test.cc
@@ -6,8 +6,6 @@
#include "chrome/browser/sync/test/integration/sync_arc_package_helper.h"
#include "chrome/browser/sync/test/integration/sync_integration_test_util.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
-#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.h"
-#include "components/arc/arc_util.h"
namespace arc {
@@ -22,45 +20,13 @@ bool AllProfilesHaveSameArcPackageDetails() {
class TwoClientArcPackageSyncTest : public SyncTest {
public:
- TwoClientArcPackageSyncTest()
- : SyncTest(TWO_CLIENT_LEGACY), sync_helper_(nullptr) {
+ TwoClientArcPackageSyncTest() : SyncTest(TWO_CLIENT_LEGACY) {
DisableVerifier();
}
~TwoClientArcPackageSyncTest() override {}
- bool SetupClients() override {
- if (!SyncTest::SetupClients())
- return false;
-
- // Init SyncArcPackageHelper to ensure that the arc services are initialized
- // for each Profile.
- sync_helper_ = SyncArcPackageHelper::GetInstance();
- return sync_helper_ != nullptr;
- }
-
- void SetUpOnMainThread() override {
- // This setting does not affect the profile created by InProcessBrowserTest.
- // Only sync test profiles are affected.
- ArcAppListPrefsFactory::SetFactoryForSyncTest();
- }
-
- // Sets up command line flags required for Arc sync tests.
- void SetUpCommandLine(base::CommandLine* cl) override {
- SetArcAvailableCommandLineForTesting(cl);
- SyncTest::SetUpCommandLine(cl);
- }
-
- void TearDownOnMainThread() override {
- sync_helper_ = nullptr;
- SyncTest::TearDownOnMainThread();
- }
-
- SyncArcPackageHelper* sync_helper() { return sync_helper_; }
-
private:
- SyncArcPackageHelper* sync_helper_;
-
DISALLOW_COPY_AND_ASSIGN(TwoClientArcPackageSyncTest);
};
@@ -75,8 +41,8 @@ IN_PROC_BROWSER_TEST_F(TwoClientArcPackageSyncTest, StartWithSamePackages) {
constexpr size_t kNumPackages = 5;
for (size_t i = 0; i < kNumPackages; ++i) {
- sync_helper()->InstallPackageWithIndex(GetProfile(0), i);
- sync_helper()->InstallPackageWithIndex(GetProfile(1), i);
+ sync_arc_helper()->InstallPackageWithIndex(GetProfile(0), i);
+ sync_arc_helper()->InstallPackageWithIndex(GetProfile(1), i);
}
ASSERT_TRUE(SetupSync());
@@ -92,7 +58,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientArcPackageSyncTest,
constexpr size_t kNumPackages = 5;
for (size_t i = 0; i < kNumPackages; ++i) {
- sync_helper()->InstallPackageWithIndex(GetProfile(0), i);
+ sync_arc_helper()->InstallPackageWithIndex(GetProfile(0), i);
}
ASSERT_FALSE(AllProfilesHaveSameArcPackageDetails());
@@ -110,12 +76,12 @@ IN_PROC_BROWSER_TEST_F(TwoClientArcPackageSyncTest,
constexpr size_t kNumPackages = 5;
for (size_t i = 0; i < kNumPackages; ++i) {
- sync_helper()->InstallPackageWithIndex(GetProfile(0), i);
- sync_helper()->InstallPackageWithIndex(GetProfile(1), i);
+ sync_arc_helper()->InstallPackageWithIndex(GetProfile(0), i);
+ sync_arc_helper()->InstallPackageWithIndex(GetProfile(1), i);
}
for (size_t i = 0; i < kNumPackages; ++i) {
- sync_helper()->InstallPackageWithIndex(GetProfile(0), i + kNumPackages);
+ sync_arc_helper()->InstallPackageWithIndex(GetProfile(0), i + kNumPackages);
}
ASSERT_FALSE(AllProfilesHaveSameArcPackageDetails());
@@ -134,8 +100,9 @@ IN_PROC_BROWSER_TEST_F(TwoClientArcPackageSyncTest,
constexpr size_t kNumPackages = 5;
constexpr size_t kPackageIdDiff = 1;
for (size_t i = 0; i < kNumPackages; ++i) {
- sync_helper()->InstallPackageWithIndex(GetProfile(0), i);
- sync_helper()->InstallPackageWithIndex(GetProfile(1), i + kPackageIdDiff);
+ sync_arc_helper()->InstallPackageWithIndex(GetProfile(0), i);
+ sync_arc_helper()->InstallPackageWithIndex(GetProfile(1),
+ i + kPackageIdDiff);
}
EXPECT_FALSE(AllProfilesHaveSameArcPackageDetails());
@@ -150,7 +117,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientArcPackageSyncTest, Install) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameArcPackageDetails());
- sync_helper()->InstallPackageWithIndex(GetProfile(0), 0);
+ sync_arc_helper()->InstallPackageWithIndex(GetProfile(0), 0);
ASSERT_TRUE(AwaitQuiescence());
EXPECT_TRUE(AllProfilesHaveSameArcPackageDetails());
}
@@ -164,8 +131,9 @@ IN_PROC_BROWSER_TEST_F(TwoClientArcPackageSyncTest, InstallDifferent) {
constexpr size_t kNumPackages = 5;
constexpr size_t kPackageIdDiff = 3;
for (size_t i = 0; i < kNumPackages; ++i) {
- sync_helper()->InstallPackageWithIndex(GetProfile(0), i);
- sync_helper()->InstallPackageWithIndex(GetProfile(1), i + kPackageIdDiff);
+ sync_arc_helper()->InstallPackageWithIndex(GetProfile(0), i);
+ sync_arc_helper()->InstallPackageWithIndex(GetProfile(1),
+ i + kPackageIdDiff);
}
ASSERT_TRUE(AwaitQuiescence());
@@ -178,11 +146,11 @@ IN_PROC_BROWSER_TEST_F(TwoClientArcPackageSyncTest, Uninstall) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameArcPackageDetails());
- sync_helper()->InstallPackageWithIndex(GetProfile(0), 1);
+ sync_arc_helper()->InstallPackageWithIndex(GetProfile(0), 1);
ASSERT_TRUE(AwaitQuiescence());
EXPECT_TRUE(AllProfilesHaveSameArcPackageDetails());
- sync_helper()->UninstallPackageWithIndex(GetProfile(1), 1);
+ sync_arc_helper()->UninstallPackageWithIndex(GetProfile(1), 1);
EXPECT_FALSE(AllProfilesHaveSameArcPackageDetails());
ASSERT_TRUE(AwaitQuiescence());
EXPECT_TRUE(AllProfilesHaveSameArcPackageDetails());
« no previous file with comments | « chrome/browser/sync/test/integration/sync_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698