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_test.h" | 7 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 8 #include "chrome/browser/sync/test/integration/updated_progress_marker_checker.h " | 8 #include "chrome/browser/sync/test/integration/updated_progress_marker_checker.h " |
| 9 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.h" | |
| 9 #include "chrome/browser/ui/app_list/arc/arc_package_syncable_service.h" | 10 #include "chrome/browser/ui/app_list/arc/arc_package_syncable_service.h" |
| 10 | 11 |
| 11 namespace arc { | 12 namespace arc { |
| 12 | 13 |
| 13 namespace { | 14 namespace { |
| 14 | 15 |
| 15 bool AllProfilesHaveSameArcPackageDetails() { | 16 bool AllProfilesHaveSameArcPackageDetails() { |
| 16 return SyncArcPackageHelper::GetInstance() | 17 return SyncArcPackageHelper::GetInstance() |
| 17 ->AllProfilesHaveSamePackageDetails(); | 18 ->AllProfilesHaveSamePackageDetails(); |
| 18 } | 19 } |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 29 bool SetupClients() override { | 30 bool SetupClients() override { |
| 30 if (!SyncTest::SetupClients()) | 31 if (!SyncTest::SetupClients()) |
| 31 return false; | 32 return false; |
| 32 | 33 |
| 33 // Init SyncArcPackageHelper to ensure that the arc services are initialized | 34 // Init SyncArcPackageHelper to ensure that the arc services are initialized |
| 34 // for each Profile. | 35 // for each Profile. |
| 35 sync_helper_ = SyncArcPackageHelper::GetInstance(); | 36 sync_helper_ = SyncArcPackageHelper::GetInstance(); |
| 36 return sync_helper_ != nullptr; | 37 return sync_helper_ != nullptr; |
| 37 } | 38 } |
| 38 | 39 |
| 40 void SetUpOnMainThread() override { | |
|
lgcheng
2017/02/22 23:36:44
Moved from sync_arc_package_helper. It seems the e
| |
| 41 ArcAppListPrefsFactory::SetFactoryForSyncTest(); | |
| 42 } | |
| 43 | |
| 39 void TearDownOnMainThread() override { | 44 void TearDownOnMainThread() override { |
| 40 sync_helper_->CleanUp(); | 45 sync_helper_->CleanUp(); |
| 41 sync_helper_ = nullptr; | 46 sync_helper_ = nullptr; |
| 42 SyncTest::TearDownOnMainThread(); | 47 SyncTest::TearDownOnMainThread(); |
| 43 } | 48 } |
| 44 | 49 |
| 45 SyncArcPackageHelper* sync_helper() { return sync_helper_; } | 50 SyncArcPackageHelper* sync_helper() { return sync_helper_; } |
| 46 | 51 |
| 47 private: | 52 private: |
| 48 SyncArcPackageHelper* sync_helper_; | 53 SyncArcPackageHelper* sync_helper_; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 64 for (size_t i = 0; i < kNumPackages; ++i) { | 69 for (size_t i = 0; i < kNumPackages; ++i) { |
| 65 sync_helper()->InstallPackageWithIndex(GetProfile(0), i); | 70 sync_helper()->InstallPackageWithIndex(GetProfile(0), i); |
| 66 sync_helper()->InstallPackageWithIndex(verifier(), i); | 71 sync_helper()->InstallPackageWithIndex(verifier(), i); |
| 67 } | 72 } |
| 68 | 73 |
| 69 ASSERT_TRUE(UpdatedProgressMarkerChecker(GetSyncService(0)).Wait()); | 74 ASSERT_TRUE(UpdatedProgressMarkerChecker(GetSyncService(0)).Wait()); |
| 70 ASSERT_TRUE(AllProfilesHaveSameArcPackageDetails()); | 75 ASSERT_TRUE(AllProfilesHaveSameArcPackageDetails()); |
| 71 } | 76 } |
| 72 | 77 |
| 73 } // namespace arc | 78 } // namespace arc |
| OLD | NEW |