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

Side by Side Diff: chrome/browser/ui/app_list/arc/arc_app_test.cc

Issue 2708923013: Split ArcSessionManager::OnPrimaryUserProfilePrepared(). (Closed)
Patch Set: rebase Created 3 years, 9 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
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/ui/app_list/arc/arc_app_test.h" 5 #include "chrome/browser/ui/app_list/arc/arc_app_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 if (!arc_app_list_pref_) { 79 if (!arc_app_list_pref_) {
80 ArcAppListPrefsFactory::GetInstance()->RecreateServiceInstanceForTesting( 80 ArcAppListPrefsFactory::GetInstance()->RecreateServiceInstanceForTesting(
81 profile_); 81 profile_);
82 } 82 }
83 arc_service_manager_ = base::MakeUnique<arc::ArcServiceManager>(nullptr); 83 arc_service_manager_ = base::MakeUnique<arc::ArcServiceManager>(nullptr);
84 arc_session_manager_ = base::MakeUnique<arc::ArcSessionManager>( 84 arc_session_manager_ = base::MakeUnique<arc::ArcSessionManager>(
85 base::MakeUnique<arc::ArcSessionRunner>( 85 base::MakeUnique<arc::ArcSessionRunner>(
86 base::Bind(arc::FakeArcSession::Create))); 86 base::Bind(arc::FakeArcSession::Create)));
87 DCHECK(arc::ArcSessionManager::Get()); 87 DCHECK(arc::ArcSessionManager::Get());
88 arc::ArcSessionManager::DisableUIForTesting(); 88 arc::ArcSessionManager::DisableUIForTesting();
89 arc_session_manager_->OnPrimaryUserProfilePrepared(profile_); 89 arc_session_manager_->SetProfile(profile_);
90 arc_session_manager_->StartPreferenceHandler();
90 91
91 arc_app_list_pref_ = ArcAppListPrefs::Get(profile_); 92 arc_app_list_pref_ = ArcAppListPrefs::Get(profile_);
92 DCHECK(arc_app_list_pref_); 93 DCHECK(arc_app_list_pref_);
93 base::RunLoop run_loop; 94 base::RunLoop run_loop;
94 arc_app_list_pref_->SetDefaltAppsReadyCallback(run_loop.QuitClosure()); 95 arc_app_list_pref_->SetDefaltAppsReadyCallback(run_loop.QuitClosure());
95 run_loop.Run(); 96 run_loop.Run();
96 97
97 arc::SetArcPlayStoreEnabledForProfile(profile_, true); 98 arc::SetArcPlayStoreEnabledForProfile(profile_, true);
98 // Check initial conditions. 99 // Check initial conditions.
99 EXPECT_FALSE(arc_session_manager_->IsSessionRunning()); 100 EXPECT_FALSE(arc_session_manager_->IsSessionRunning());
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } 212 }
212 } 213 }
213 214
214 bool ArcAppTest::FindPackage(const arc::mojom::ArcPackageInfo& package) { 215 bool ArcAppTest::FindPackage(const arc::mojom::ArcPackageInfo& package) {
215 for (auto fake_package : fake_packages_) { 216 for (auto fake_package : fake_packages_) {
216 if (package.package_name == fake_package.package_name) 217 if (package.package_name == fake_package.package_name)
217 return true; 218 return true;
218 } 219 }
219 return false; 220 return false;
220 } 221 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698