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( |