| 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_session_manager.h" | 13 #include "chrome/browser/chromeos/arc/arc_session_manager.h" |
| 14 #include "chrome/browser/chromeos/arc/arc_util.h" |
| 14 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" | 15 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" |
| 15 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 16 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
| 16 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 17 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" | 19 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
| 19 #include "chrome/browser/sync/test/integration/sync_test.h" | 20 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 20 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 21 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
| 21 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.h" | 22 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.h" |
| 22 #include "chrome/browser/ui/app_list/arc/arc_package_syncable_service.h" | 23 #include "chrome/browser/ui/app_list/arc/arc_package_syncable_service.h" |
| 23 #include "chromeos/chromeos_switches.h" | 24 #include "chromeos/chromeos_switches.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 const user_manager::User* user = CreateUserAndLogin(profile, id); | 147 const user_manager::User* user = CreateUserAndLogin(profile, id); |
| 147 // Have the user-to-profile mapping ready to avoid using the real profile | 148 // Have the user-to-profile mapping ready to avoid using the real profile |
| 148 // manager (which is null). | 149 // manager (which is null). |
| 149 chromeos::ProfileHelper::Get()->SetUserToProfileMappingForTesting(user, | 150 chromeos::ProfileHelper::Get()->SetUserToProfileMappingForTesting(user, |
| 150 profile); | 151 profile); |
| 151 | 152 |
| 152 ArcSessionManager* arc_session_manager = ArcSessionManager::Get(); | 153 ArcSessionManager* arc_session_manager = ArcSessionManager::Get(); |
| 153 DCHECK(arc_session_manager); | 154 DCHECK(arc_session_manager); |
| 154 ArcSessionManager::DisableUIForTesting(); | 155 ArcSessionManager::DisableUIForTesting(); |
| 155 arc_session_manager->OnPrimaryUserProfilePrepared(profile); | 156 arc_session_manager->OnPrimaryUserProfilePrepared(profile); |
| 156 arc_session_manager->SetArcPlayStoreEnabled(true); | 157 arc::SetArcPlayStoreEnabledForProfile(profile, true); |
| 157 | 158 |
| 158 ArcAppListPrefs* arc_app_list_prefs = ArcAppListPrefs::Get(profile); | 159 ArcAppListPrefs* arc_app_list_prefs = ArcAppListPrefs::Get(profile); |
| 159 DCHECK(arc_app_list_prefs); | 160 DCHECK(arc_app_list_prefs); |
| 160 | 161 |
| 161 base::RunLoop run_loop; | 162 base::RunLoop run_loop; |
| 162 arc_app_list_prefs->SetDefaltAppsReadyCallback(run_loop.QuitClosure()); | 163 arc_app_list_prefs->SetDefaltAppsReadyCallback(run_loop.QuitClosure()); |
| 163 run_loop.Run(); | 164 run_loop.Run(); |
| 164 | 165 |
| 165 instance_map_[profile] = | 166 instance_map_[profile] = |
| 166 base::MakeUnique<FakeAppInstance>(arc_app_list_prefs); | 167 base::MakeUnique<FakeAppInstance>(arc_app_list_prefs); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 if (package1_info->last_backup_android_id != | 245 if (package1_info->last_backup_android_id != |
| 245 package2_info->last_backup_android_id) | 246 package2_info->last_backup_android_id) |
| 246 return false; | 247 return false; |
| 247 if (package1_info->last_backup_time != package2_info->last_backup_time) | 248 if (package1_info->last_backup_time != package2_info->last_backup_time) |
| 248 return false; | 249 return false; |
| 249 } | 250 } |
| 250 return true; | 251 return true; |
| 251 } | 252 } |
| 252 | 253 |
| 253 } // namespace arc | 254 } // namespace arc |
| OLD | NEW |