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

Unified Diff: ash/system/chromeos/power/tablet_power_button_controller_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
Index: ash/system/chromeos/power/tablet_power_button_controller_unittest.cc
diff --git a/ash/system/chromeos/power/tablet_power_button_controller_unittest.cc b/ash/system/chromeos/power/tablet_power_button_controller_unittest.cc
index 3f06a501e28d74f6e0b6cb5b3f11c513e3ed9c0a..4415359e3a0c06b73d7e20bf3d5e06de7c68047f 100644
--- a/ash/system/chromeos/power/tablet_power_button_controller_unittest.cc
+++ b/ash/system/chromeos/power/tablet_power_button_controller_unittest.cc
@@ -7,7 +7,8 @@
#include <memory>
#include "ash/common/ash_switches.h"
-#include "ash/common/session/session_state_delegate.h"
+#include "ash/common/session/session_controller.h"
+#include "ash/common/test/test_session_controller_client.h"
#include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/shell.h"
@@ -93,7 +94,7 @@ class TabletPowerButtonControllerTest : public AshTestBase {
void UnlockScreen() {
lock_state_controller_->OnLockStateChanged(false);
- WmShell::Get()->GetSessionStateDelegate()->UnlockScreen();
+ GetSessionControllerClient()->UnlockScreen();
}
void Initialize(LoginStatus status) {
@@ -108,7 +109,12 @@ class TabletPowerButtonControllerTest : public AshTestBase {
}
bool GetLockedState() {
- return WmShell::Get()->GetSessionStateDelegate()->IsScreenLocked();
+ // LockScreen is an async mojo call. Spin message loop to ensure it is
+ // delivered.
+ SessionController* const session_controller =
+ WmShell::Get()->session_controller();
+ session_controller->FlushMojoForTest();
+ return session_controller->IsScreenLocked();
}
bool GetBacklightsForcedOff() WARN_UNUSED_RESULT {
« no previous file with comments | « ash/system/chromeos/power/tablet_power_button_controller.cc ('k') | ash/system/chromeos/power/video_activity_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698