Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |