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

Side by Side Diff: chrome/browser/sync/test/integration/two_client_arc_package_sync_test.cc

Issue 2711033002: Fix Arc integration test. (Closed)
Patch Set: Donnot touch instance_holder. Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/sync/test/integration/sync_arc_package_helper.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/profiles/profile.h" 5 #include "chrome/browser/profiles/profile.h"
6 #include "chrome/browser/sync/test/integration/sync_arc_package_helper.h" 6 #include "chrome/browser/sync/test/integration/sync_arc_package_helper.h"
7 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" 7 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h"
8 #include "chrome/browser/sync/test/integration/sync_test.h" 8 #include "chrome/browser/sync/test/integration/sync_test.h"
9 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.h"
9 10
10 namespace arc { 11 namespace arc {
11 12
12 namespace { 13 namespace {
13 14
14 bool AllProfilesHaveSameArcPackageDetails() { 15 bool AllProfilesHaveSameArcPackageDetails() {
15 return SyncArcPackageHelper::GetInstance() 16 return SyncArcPackageHelper::GetInstance()
16 ->AllProfilesHaveSamePackageDetails(); 17 ->AllProfilesHaveSamePackageDetails();
17 } 18 }
18 19
(...skipping 11 matching lines...) Expand all
30 bool SetupClients() override { 31 bool SetupClients() override {
31 if (!SyncTest::SetupClients()) 32 if (!SyncTest::SetupClients())
32 return false; 33 return false;
33 34
34 // Init SyncArcPackageHelper to ensure that the arc services are initialized 35 // Init SyncArcPackageHelper to ensure that the arc services are initialized
35 // for each Profile. 36 // for each Profile.
36 sync_helper_ = SyncArcPackageHelper::GetInstance(); 37 sync_helper_ = SyncArcPackageHelper::GetInstance();
37 return sync_helper_ != nullptr; 38 return sync_helper_ != nullptr;
38 } 39 }
39 40
41 void SetUpOnMainThread() override {
42 ArcAppListPrefsFactory::SetFactoryForSyncTest();
hidehiko 2017/02/23 06:31:45 This runs after initial profile creation. Is it ex
lgcheng 2017/02/23 18:27:05 When you mentioned initial profile, did you mean t
hidehiko 2017/02/23 19:12:24 Yes. I know it is not interesting for the test ca
43 }
44
40 void TearDownOnMainThread() override { 45 void TearDownOnMainThread() override {
41 sync_helper_->CleanUp(); 46 sync_helper_->CleanUp();
42 sync_helper_ = nullptr; 47 sync_helper_ = nullptr;
43 SyncTest::TearDownOnMainThread(); 48 SyncTest::TearDownOnMainThread();
44 } 49 }
45 50
46 SyncArcPackageHelper* sync_helper() { return sync_helper_; } 51 SyncArcPackageHelper* sync_helper() { return sync_helper_; }
47 52
48 private: 53 private:
49 SyncArcPackageHelper* sync_helper_; 54 SyncArcPackageHelper* sync_helper_;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 ASSERT_TRUE(AwaitQuiescence()); 174 ASSERT_TRUE(AwaitQuiescence());
170 EXPECT_TRUE(AllProfilesHaveSameArcPackageDetails()); 175 EXPECT_TRUE(AllProfilesHaveSameArcPackageDetails());
171 176
172 sync_helper()->UninstallPackageWithIndex(GetProfile(1), 1); 177 sync_helper()->UninstallPackageWithIndex(GetProfile(1), 1);
173 EXPECT_FALSE(AllProfilesHaveSameArcPackageDetails()); 178 EXPECT_FALSE(AllProfilesHaveSameArcPackageDetails());
174 ASSERT_TRUE(AwaitQuiescence()); 179 ASSERT_TRUE(AwaitQuiescence());
175 EXPECT_TRUE(AllProfilesHaveSameArcPackageDetails()); 180 EXPECT_TRUE(AllProfilesHaveSameArcPackageDetails());
176 } 181 }
177 182
178 } // namespace arc 183 } // namespace arc
OLDNEW
« no previous file with comments | « chrome/browser/sync/test/integration/sync_arc_package_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698