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

Side by Side Diff: chrome/browser/ui/ash/launcher/arc_app_launcher_browsertest.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 "ash/common/shelf/shelf_delegate.h" 5 #include "ash/common/shelf/shelf_delegate.h"
6 #include "ash/common/wm_shell.h" 6 #include "ash/common/wm_shell.h"
7 #include "ash/wm/window_util.h" 7 #include "ash/wm/window_util.h"
8 #include "base/macros.h" 8 #include "base/macros.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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 void SendInstallationFinished(const std::string& package_name, bool success) { 237 void SendInstallationFinished(const std::string& package_name, bool success) {
238 arc::mojom::InstallationResult result; 238 arc::mojom::InstallationResult result;
239 result.package_name = package_name; 239 result.package_name = package_name;
240 result.success = success; 240 result.success = success;
241 app_host()->OnInstallationFinished( 241 app_host()->OnInstallationFinished(
242 arc::mojom::InstallationResultPtr(result.Clone())); 242 arc::mojom::InstallationResultPtr(result.Clone()));
243 base::RunLoop().RunUntilIdle(); 243 base::RunLoop().RunUntilIdle();
244 } 244 }
245 245
246 void StartInstance() { 246 void StartInstance() {
247 if (arc_session_manager()->profile() != profile()) 247 if (arc_session_manager()->profile() != profile()) {
248 arc_session_manager()->OnPrimaryUserProfilePrepared(profile()); 248 arc_session_manager()->SetProfile(profile());
249 arc_session_manager()->StartPreferenceHandler();
250 }
249 app_instance_observer()->OnInstanceReady(); 251 app_instance_observer()->OnInstanceReady();
250 } 252 }
251 253
252 void StopInstance() { 254 void StopInstance() {
253 arc_session_manager()->Shutdown(); 255 arc_session_manager()->Shutdown();
254 app_instance_observer()->OnInstanceClosed(); 256 app_instance_observer()->OnInstanceClosed();
255 } 257 }
256 258
257 LauncherItemController* GetAppItemController(const std::string& id) { 259 LauncherItemController* GetAppItemController(const std::string& id) {
258 const ash::ShelfID shelf_id = shelf_delegate()->GetShelfIDForAppID(id); 260 const ash::ShelfID shelf_id = shelf_delegate()->GetShelfIDForAppID(id);
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 app_host()->OnTaskDestroyed(2); 545 app_host()->OnTaskDestroyed(2);
544 EXPECT_EQ(controller2, GetAppItemController(shelf_id2)); 546 EXPECT_EQ(controller2, GetAppItemController(shelf_id2));
545 // Destroy task #2, this kills shelf group 2 547 // Destroy task #2, this kills shelf group 2
546 app_host()->OnTaskDestroyed(3); 548 app_host()->OnTaskDestroyed(3);
547 EXPECT_FALSE(GetAppItemController(shelf_id2)); 549 EXPECT_FALSE(GetAppItemController(shelf_id2));
548 550
549 // Disable ARC, this removes app and as result kills shelf group 3. 551 // Disable ARC, this removes app and as result kills shelf group 3.
550 arc::SetArcPlayStoreEnabledForProfile(profile(), false); 552 arc::SetArcPlayStoreEnabledForProfile(profile(), false);
551 EXPECT_FALSE(GetAppItemController(shelf_id3)); 553 EXPECT_FALSE(GetAppItemController(shelf_id3));
552 } 554 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698