| 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/sync/test/integration/sync_arc_package_helper.h" | 5 #include "chrome/browser/sync/test/integration/sync_arc_package_helper.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "chrome/browser/chromeos/arc/arc_auth_notification.h" |
| 14 #include "chrome/browser/chromeos/arc/arc_service_launcher.h" |
| 13 #include "chrome/browser/chromeos/arc/arc_session_manager.h" | 15 #include "chrome/browser/chromeos/arc/arc_session_manager.h" |
| 14 #include "chrome/browser/chromeos/arc/arc_util.h" | 16 #include "chrome/browser/chromeos/arc/arc_util.h" |
| 15 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" | 17 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" |
| 16 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 18 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
| 17 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 19 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 18 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
| 19 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" | 21 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
| 20 #include "chrome/browser/sync/test/integration/sync_test.h" | 22 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 21 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 23 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
| 22 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.h" | 24 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 } | 145 } |
| 144 | 146 |
| 145 void SyncArcPackageHelper::SetupArcService(Profile* profile, size_t id) { | 147 void SyncArcPackageHelper::SetupArcService(Profile* profile, size_t id) { |
| 146 DCHECK(profile); | 148 DCHECK(profile); |
| 147 const user_manager::User* user = CreateUserAndLogin(profile, id); | 149 const user_manager::User* user = CreateUserAndLogin(profile, id); |
| 148 // Have the user-to-profile mapping ready to avoid using the real profile | 150 // Have the user-to-profile mapping ready to avoid using the real profile |
| 149 // manager (which is null). | 151 // manager (which is null). |
| 150 chromeos::ProfileHelper::Get()->SetUserToProfileMappingForTesting(user, | 152 chromeos::ProfileHelper::Get()->SetUserToProfileMappingForTesting(user, |
| 151 profile); | 153 profile); |
| 152 | 154 |
| 153 ArcSessionManager* arc_session_manager = ArcSessionManager::Get(); | |
| 154 DCHECK(arc_session_manager); | |
| 155 ArcSessionManager::DisableUIForTesting(); | 155 ArcSessionManager::DisableUIForTesting(); |
| 156 arc_session_manager->SetProfile(profile); | 156 ArcAuthNotification::DisableForTesting(); |
| 157 arc_session_manager->StartPreferenceHandler(); | 157 arc::ArcServiceLauncher::Get()->OnPrimaryUserProfilePrepared(profile); |
| 158 arc::SetArcPlayStoreEnabledForProfile(profile, true); | 158 arc::SetArcPlayStoreEnabledForProfile(profile, true); |
| 159 | 159 |
| 160 ArcAppListPrefs* arc_app_list_prefs = ArcAppListPrefs::Get(profile); | 160 ArcAppListPrefs* arc_app_list_prefs = ArcAppListPrefs::Get(profile); |
| 161 DCHECK(arc_app_list_prefs); | 161 DCHECK(arc_app_list_prefs); |
| 162 | 162 |
| 163 base::RunLoop run_loop; | 163 base::RunLoop run_loop; |
| 164 arc_app_list_prefs->SetDefaltAppsReadyCallback(run_loop.QuitClosure()); | 164 arc_app_list_prefs->SetDefaltAppsReadyCallback(run_loop.QuitClosure()); |
| 165 run_loop.Run(); | 165 run_loop.Run(); |
| 166 | 166 |
| 167 instance_map_[profile] = | 167 instance_map_[profile] = |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 if (package1_info->last_backup_android_id != | 246 if (package1_info->last_backup_android_id != |
| 247 package2_info->last_backup_android_id) | 247 package2_info->last_backup_android_id) |
| 248 return false; | 248 return false; |
| 249 if (package1_info->last_backup_time != package2_info->last_backup_time) | 249 if (package1_info->last_backup_time != package2_info->last_backup_time) |
| 250 return false; | 250 return false; |
| 251 } | 251 } |
| 252 return true; | 252 return true; |
| 253 } | 253 } |
| 254 | 254 |
| 255 } // namespace arc | 255 } // namespace arc |
| OLD | NEW |