Chromium Code Reviews| Index: chrome/browser/ui/app_list/arc/arc_app_test.cc |
| diff --git a/chrome/browser/ui/app_list/arc/arc_app_test.cc b/chrome/browser/ui/app_list/arc/arc_app_test.cc |
| index 94ad8c212e71cd38e092189eb1a0664089270df4..87bb4ca12a82da7c1de31c23371a33c7f50eec0a 100644 |
| --- a/chrome/browser/ui/app_list/arc/arc_app_test.cc |
| +++ b/chrome/browser/ui/app_list/arc/arc_app_test.cc |
| @@ -95,11 +95,8 @@ void ArcAppTest::SetUp(Profile* profile) { |
| profile_, arc_session_manager_.get()); |
| arc_play_store_enabled_preference_handler_->Start(); |
| - arc_app_list_pref_ = ArcAppListPrefs::Get(profile_); |
| - DCHECK(arc_app_list_pref_); |
| - base::RunLoop run_loop; |
| - arc_app_list_pref_->SetDefaltAppsReadyCallback(run_loop.QuitClosure()); |
| - run_loop.Run(); |
| + if (wait_default_apps_) |
| + WaitForDefaultApps(); |
| // Check initial conditions. |
| if (arc::ShouldArcAlwaysStart()) { |
| @@ -110,11 +107,21 @@ void ArcAppTest::SetUp(Profile* profile) { |
| EXPECT_FALSE(arc_session_manager_->IsSessionRunning()); |
| } |
| + arc_app_list_pref_ = ArcAppListPrefs::Get(profile_); |
|
hidehiko
2017/03/16 16:23:19
Initializing twice looks not straightforward.
Cou
khmel
2017/03/16 16:38:47
Done.
|
| + DCHECK(arc_app_list_pref_); |
| app_instance_.reset(new arc::FakeAppInstance(arc_app_list_pref_)); |
| arc_service_manager_->arc_bridge_service()->app()->SetInstance( |
| app_instance_.get()); |
| } |
| +void ArcAppTest::WaitForDefaultApps() { |
| + arc_app_list_pref_ = ArcAppListPrefs::Get(profile_); |
| + DCHECK(arc_app_list_pref_); |
| + base::RunLoop run_loop; |
| + arc_app_list_pref_->SetDefaltAppsReadyCallback(run_loop.QuitClosure()); |
| + run_loop.Run(); |
| +} |
| + |
| void ArcAppTest::CreateFakeAppsAndPackages() { |
| arc::mojom::AppInfo app; |
| // Make sure we have enough data for test. |