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

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

Issue 2801333002: mash: Run pre-unlock animation via SessionController (Closed)
Patch Set: fix compile 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..ac07ccb7374c25f964ccb1e0a6ae97a8f9a8f5cd 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())
+ ->OnLockStateChanged(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));
}

Powered by Google App Engine
This is Rietveld 408576698