| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/shell.h" | 5 #include "ash/shell.h" |
| 6 #include "ash/system/system_notifier.h" | 6 #include "ash/system/system_notifier.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/chromeos/login/login_manager_test.h" | 8 #include "chrome/browser/chromeos/login/login_manager_test.h" |
| 9 #include "chrome/browser/chromeos/login/startup_utils.h" | 9 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 10 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" | 10 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 LoginStateNotificationBlockerChromeOSBrowserTest() | 28 LoginStateNotificationBlockerChromeOSBrowserTest() |
| 29 : chromeos::LoginManagerTest(false), | 29 : chromeos::LoginManagerTest(false), |
| 30 state_changed_count_(0) {} | 30 state_changed_count_(0) {} |
| 31 virtual ~LoginStateNotificationBlockerChromeOSBrowserTest() {} | 31 virtual ~LoginStateNotificationBlockerChromeOSBrowserTest() {} |
| 32 | 32 |
| 33 virtual void SetUpOnMainThread() OVERRIDE { | 33 virtual void SetUpOnMainThread() OVERRIDE { |
| 34 chromeos::LoginState::Get()->set_always_logged_in(false); | 34 chromeos::LoginState::Get()->set_always_logged_in(false); |
| 35 chromeos::LoginManagerTest::SetUpOnMainThread(); | 35 chromeos::LoginManagerTest::SetUpOnMainThread(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 virtual void CleanUpOnMainThread() OVERRIDE { | 38 virtual void TearDownOnMainThread() OVERRIDE { |
| 39 if (blocker_) | 39 if (blocker_) |
| 40 blocker_->RemoveObserver(this); | 40 blocker_->RemoveObserver(this); |
| 41 blocker_.reset(); | 41 blocker_.reset(); |
| 42 chromeos::LoginManagerTest::CleanUpOnMainThread(); | 42 chromeos::LoginManagerTest::TearDownOnMainThread(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 protected: | 45 protected: |
| 46 void CreateBlocker() { | 46 void CreateBlocker() { |
| 47 blocker_.reset(new LoginStateNotificationBlockerChromeOS( | 47 blocker_.reset(new LoginStateNotificationBlockerChromeOS( |
| 48 message_center::MessageCenter::Get())); | 48 message_center::MessageCenter::Get())); |
| 49 blocker_->AddObserver(this); | 49 blocker_->AddObserver(this); |
| 50 } | 50 } |
| 51 | 51 |
| 52 // message_center::NotificationBlocker::Observer ovverrides: | 52 // message_center::NotificationBlocker::Observer ovverrides: |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 content::RunAllPendingInMessageLoop(); | 132 content::RunAllPendingInMessageLoop(); |
| 133 EXPECT_EQ(1, GetStateChangedCountAndReset()); | 133 EXPECT_EQ(1, GetStateChangedCountAndReset()); |
| 134 EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id)); | 134 EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id)); |
| 135 | 135 |
| 136 // Multi-login user switch off. | 136 // Multi-login user switch off. |
| 137 chromeos::UserAddingScreen::Get()->Cancel(); | 137 chromeos::UserAddingScreen::Get()->Cancel(); |
| 138 content::RunAllPendingInMessageLoop(); | 138 content::RunAllPendingInMessageLoop(); |
| 139 EXPECT_EQ(1, GetStateChangedCountAndReset()); | 139 EXPECT_EQ(1, GetStateChangedCountAndReset()); |
| 140 EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id)); | 140 EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id)); |
| 141 } | 141 } |
| OLD | NEW |