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

Unified Diff: ash/system/chromeos/power/tablet_power_button_controller_unittest.cc

Issue 2734933004: ash: Use SessionController instead of SessionStateDelegate (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 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..40db38feafcfa67b7d262e5f70c5c5a0a944cefd 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,10 @@ 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.
+ RunAllPendingInMessageLoop();
James Cook 2017/03/17 17:14:36 This might be a good candidate for SessionControll
xiyuan 2017/03/17 22:52:03 Done.
+ return WmShell::Get()->session_controller()->IsScreenLocked();
}
bool GetBacklightsForcedOff() WARN_UNUSED_RESULT {

Powered by Google App Engine
This is Rietveld 408576698