| 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 <string> | 7 #include <string> |
| 8 #include <unordered_map> | 8 #include <unordered_map> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 DCHECK(arc_app_list_prefs); | 164 DCHECK(arc_app_list_prefs); |
| 165 | 165 |
| 166 base::RunLoop run_loop; | 166 base::RunLoop run_loop; |
| 167 arc_app_list_prefs->SetDefaltAppsReadyCallback(run_loop.QuitClosure()); | 167 arc_app_list_prefs->SetDefaltAppsReadyCallback(run_loop.QuitClosure()); |
| 168 run_loop.Run(); | 168 run_loop.Run(); |
| 169 | 169 |
| 170 instance_map_[profile].reset(new FakeAppInstance(arc_app_list_prefs)); | 170 instance_map_[profile].reset(new FakeAppInstance(arc_app_list_prefs)); |
| 171 DCHECK(instance_map_[profile].get()); | 171 DCHECK(instance_map_[profile].get()); |
| 172 arc_app_list_prefs->app_instance_holder()->SetInstance( | 172 arc_app_list_prefs->app_instance_holder()->SetInstance( |
| 173 instance_map_[profile].get()); | 173 instance_map_[profile].get()); |
| 174 // OnPackageListRefreshed will be called when AppInstance is ready. |
| 175 // For fakeAppInstance we use SendRefreshPackageList to make sure that |
| 176 // OnPackageListRefreshed will be called. |
| 177 instance_map_[profile]->SendRefreshPackageList( |
| 178 std::vector<arc::mojom::ArcPackageInfo>()); |
| 174 } | 179 } |
| 175 | 180 |
| 176 void SyncArcPackageHelper::InstallPackage( | 181 void SyncArcPackageHelper::InstallPackage( |
| 177 Profile* profile, | 182 Profile* profile, |
| 178 const mojom::ArcPackageInfo& package) { | 183 const mojom::ArcPackageInfo& package) { |
| 179 ArcAppListPrefs* arc_app_list_prefs = ArcAppListPrefs::Get(profile); | 184 ArcAppListPrefs* arc_app_list_prefs = ArcAppListPrefs::Get(profile); |
| 180 DCHECK(arc_app_list_prefs); | 185 DCHECK(arc_app_list_prefs); |
| 181 FakeAppInstance* fake_app_instance = static_cast<FakeAppInstance*>( | 186 FakeAppInstance* fake_app_instance = static_cast<FakeAppInstance*>( |
| 182 arc_app_list_prefs->app_instance_holder()->instance()); | 187 arc_app_list_prefs->app_instance_holder()->instance()); |
| 183 | 188 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 if (package1_info->last_backup_android_id != | 248 if (package1_info->last_backup_android_id != |
| 244 package2_info->last_backup_android_id) | 249 package2_info->last_backup_android_id) |
| 245 return false; | 250 return false; |
| 246 if (package1_info->last_backup_time != package2_info->last_backup_time) | 251 if (package1_info->last_backup_time != package2_info->last_backup_time) |
| 247 return false; | 252 return false; |
| 248 } | 253 } |
| 249 return true; | 254 return true; |
| 250 } | 255 } |
| 251 | 256 |
| 252 } // namespace arc | 257 } // namespace arc |
| OLD | NEW |