Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Side by Side Diff: chrome/browser/sync/test/integration/sync_arc_package_helper.cc

Issue 2409253004: [Merge To M54]arc: Fix race when arc package sync service starts. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/arc/arc_app_list_prefs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/arc/arc_app_list_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698