| 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));
|
| }
|
|
|