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

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

Issue 2353213002: arc: Fix Android App resurrected by sync. (Closed)
Patch Set: Remove redundant pref observer. Created 4 years, 3 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 206bf4db0700581aee857a8fc17e6823b4eada53..843c27c2ab3f40671472edb42db0c18797dc3db1 100644
--- a/chrome/browser/sync/test/integration/sync_arc_package_helper.cc
+++ b/chrome/browser/sync/test/integration/sync_arc_package_helper.cc
@@ -10,6 +10,7 @@
#include <vector>
#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"
@@ -147,6 +148,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).
@@ -161,6 +164,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