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

Unified Diff: ash/shell_unittest.cc

Issue 2734933004: ash: Use SessionController instead of SessionStateDelegate (Closed)
Patch Set: rebase to get WorkspaceLayoutManagerSoloTest change 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell/window_type_launcher.cc ('k') | ash/system/chromeos/power/power_event_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell_unittest.cc
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc
index ad89cd58897fe6cddc683f461e459ee9fcd36008..5c0a05f6371f6621365dffe1aaa34680210487df 100644
--- a/ash/shell_unittest.cc
+++ b/ash/shell_unittest.cc
@@ -7,10 +7,11 @@
#include <algorithm>
#include <vector>
-#include "ash/common/session/session_state_delegate.h"
+#include "ash/common/session/session_controller.h"
#include "ash/common/shelf/shelf_layout_manager.h"
#include "ash/common/shelf/shelf_widget.h"
#include "ash/common/shelf/wm_shelf.h"
+#include "ash/common/test/test_session_controller_client.h"
#include "ash/common/wallpaper/wallpaper_widget_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
@@ -156,20 +157,20 @@ class ShellTest : public test::AshTestBase {
// Create a LockScreen window.
views::Widget::InitParams widget_params(
views::Widget::InitParams::TYPE_WINDOW);
- SessionStateDelegate* delegate = WmShell::Get()->GetSessionStateDelegate();
- delegate->LockScreen();
+ SessionController* controller = WmShell::Get()->session_controller();
+ controller->LockScreenAndFlushForTest();
views::Widget* lock_widget = CreateTestWindow(widget_params);
Shell::GetContainer(Shell::GetPrimaryRootWindow(),
kShellWindowId_LockScreenContainer)
->AddChild(lock_widget->GetNativeView());
lock_widget->Show();
- EXPECT_TRUE(delegate->IsScreenLocked());
+ EXPECT_TRUE(controller->IsScreenLocked());
EXPECT_TRUE(lock_widget->GetNativeView()->HasFocus());
// Verify menu is closed.
EXPECT_EQ(nullptr, views::MenuController::GetActiveInstance());
lock_widget->Close();
- delegate->UnlockScreen();
+ GetSessionControllerClient()->UnlockScreen();
}
};
@@ -270,7 +271,7 @@ TEST_F(ShellTest, CreateLockScreenModalWindow) {
EXPECT_TRUE(
GetDefaultContainer()->Contains(widget->GetNativeWindow()->parent()));
- WmShell::Get()->GetSessionStateDelegate()->LockScreen();
+ WmShell::Get()->session_controller()->LockScreenAndFlushForTest();
// Create a LockScreen window.
views::Widget* lock_widget = CreateTestWindow(widget_params);
Shell::GetContainer(Shell::GetPrimaryRootWindow(),
@@ -327,11 +328,11 @@ TEST_F(ShellTest, CreateLockScreenModalWindow) {
}
TEST_F(ShellTest, IsScreenLocked) {
- SessionStateDelegate* delegate = WmShell::Get()->GetSessionStateDelegate();
- delegate->LockScreen();
- EXPECT_TRUE(delegate->IsScreenLocked());
- delegate->UnlockScreen();
- EXPECT_FALSE(delegate->IsScreenLocked());
+ SessionController* controller = WmShell::Get()->session_controller();
+ controller->LockScreenAndFlushForTest();
+ EXPECT_TRUE(controller->IsScreenLocked());
+ GetSessionControllerClient()->UnlockScreen();
+ EXPECT_FALSE(controller->IsScreenLocked());
}
TEST_F(ShellTest, LockScreenClosesActiveMenu) {
« no previous file with comments | « ash/shell/window_type_launcher.cc ('k') | ash/system/chromeos/power/power_event_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698