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

Unified Diff: chrome/browser/sync/test/integration/sync_arc_package_helper.cc

Issue 2410993002: [Merge To M54]:arc: Fix Android App resurrected by sync. (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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/test/integration/sync_arc_package_helper.cc
diff --git a/chrome/browser/sync/test/integration/sync_arc_package_helper.cc b/chrome/browser/sync/test/integration/sync_arc_package_helper.cc
index fac2adf67c409c01a9e7741db776b6637eb7b656..c28deda79fad5bbbabba6088962b1885fe952160 100644
--- a/chrome/browser/sync/test/integration/sync_arc_package_helper.cc
+++ b/chrome/browser/sync/test/integration/sync_arc_package_helper.cc
@@ -8,6 +8,7 @@
#include <unordered_map>
#include "base/command_line.h"
+#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/chromeos/arc/arc_auth_service.h"
#include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
@@ -145,6 +146,8 @@ bool SyncArcPackageHelper::AllProfilesHaveSamePackageDetails() {
void SyncArcPackageHelper::SetupArcService(Profile* profile, size_t id) {
DCHECK(profile);
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+ chromeos::switches::kEnableArc);
const user_manager::User* user = CreateUserAndLogin(profile, id);
// Have the user-to-profile mapping ready to avoid using the real profile
// manager (which is null).
@@ -159,6 +162,11 @@ void SyncArcPackageHelper::SetupArcService(Profile* profile, size_t id) {
ArcAppListPrefs* arc_app_list_prefs = ArcAppListPrefs::Get(profile);
DCHECK(arc_app_list_prefs);
+
+ base::RunLoop run_loop;
+ arc_app_list_prefs->SetDefaltAppsReadyCallback(run_loop.QuitClosure());
+ run_loop.Run();
+
instance_map_[profile].reset(new FakeAppInstance(arc_app_list_prefs));
DCHECK(instance_map_[profile].get());
arc_app_list_prefs->app_instance_holder()->SetInstance(
« no previous file with comments | « chrome/browser/sync/chrome_sync_client.cc ('k') | chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698