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

Unified Diff: chrome/browser/notifications/login_state_notification_blocker_chromeos_unittest.cc

Issue 2801333002: mash: Run pre-unlock animation via SessionController (Closed)
Patch Set: for #2 Created 3 years, 8 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: chrome/browser/notifications/login_state_notification_blocker_chromeos_unittest.cc
diff --git a/chrome/browser/notifications/login_state_notification_blocker_chromeos_unittest.cc b/chrome/browser/notifications/login_state_notification_blocker_chromeos_unittest.cc
index d4c0eed04424c2c1547fbfccc65aeeb4d9409654..7705f10c182edee1c89491fe9e94012a03974604 100644
--- a/chrome/browser/notifications/login_state_notification_blocker_chromeos_unittest.cc
+++ b/chrome/browser/notifications/login_state_notification_blocker_chromeos_unittest.cc
@@ -65,6 +65,12 @@ class LoginStateNotificationBlockerChromeOSTest
return blocker_->ShouldShowNotificationAsPopup(notification);
}
+ void SetLockedState(bool locked) {
+ // TODO(xiyuan): Use SessionManager and not call ash.
+ static_cast<ash::SessionStateObserver*>(ash::Shell::Get())
stevenjb 2017/04/10 15:52:44 Why do we need the static_cast here?
xiyuan 2017/04/10 16:09:53 It is because LockStateChanged is now part of Sess
+ ->LockStateChanged(locked);
+ }
+
private:
int state_changed_count_;
std::unique_ptr<message_center::NotificationBlocker> blocker_;
@@ -93,12 +99,12 @@ TEST_F(LoginStateNotificationBlockerChromeOSTest, BaseTest) {
EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id));
// Lock.
- ash::Shell::Get()->OnLockStateChanged(true);
+ SetLockedState(true);
EXPECT_EQ(1, GetStateChangedCountAndReset());
EXPECT_FALSE(ShouldShowNotificationAsPopup(notifier_id));
// Unlock.
- ash::Shell::Get()->OnLockStateChanged(false);
+ SetLockedState(false);
EXPECT_EQ(1, GetStateChangedCountAndReset());
EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id));
}
@@ -127,12 +133,12 @@ TEST_F(LoginStateNotificationBlockerChromeOSTest, AlwaysAllowedNotifier) {
EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id));
// Lock.
- ash::Shell::Get()->OnLockStateChanged(true);
+ SetLockedState(true);
EXPECT_EQ(1, GetStateChangedCountAndReset());
EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id));
// Unlock.
- ash::Shell::Get()->OnLockStateChanged(false);
+ SetLockedState(false);
EXPECT_EQ(1, GetStateChangedCountAndReset());
EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id));
}
« no previous file with comments | « chrome/browser/chromeos/power/login_lock_state_notifier.cc ('k') | chrome/browser/ui/ash/session_controller_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698