| Index: ash/common/test/test_system_tray_delegate.h
|
| diff --git a/ash/common/test/test_system_tray_delegate.h b/ash/common/test/test_system_tray_delegate.h
|
| index 3f5ca4aceaee9e0804283cc4afbab2860af525b5..3b3ee72ee095683f1e8de419c3e3c1638e4b4f8b 100644
|
| --- a/ash/common/test/test_system_tray_delegate.h
|
| +++ b/ash/common/test/test_system_tray_delegate.h
|
| @@ -23,13 +23,6 @@ class TestSystemTrayDelegate : public DefaultSystemTrayDelegate {
|
| // AshTestHelper::TearDown.
|
| static void SetSystemUpdateRequired(bool required);
|
|
|
| - // Changes the login status when initially the delegate is created. This will
|
| - // be called before AshTestBase::SetUp() to test the case when chrome is
|
| - // restarted right after the login (such like a flag is set).
|
| - // This value will be reset in AshTestHelper::TearDown, most test fixtures
|
| - // don't need to care its lifecycle.
|
| - static void SetInitialLoginStatus(LoginStatus login_status);
|
| -
|
| // Changes the current login status in the test. This also invokes
|
| // UpdateAfterLoginStatusChange(). Usually this is called in the test code to
|
| // set up a login status. This will fit to most of the test cases, but this
|
| @@ -70,6 +63,20 @@ class TestSystemTrayDelegate : public DefaultSystemTrayDelegate {
|
| DISALLOW_COPY_AND_ASSIGN(TestSystemTrayDelegate);
|
| };
|
|
|
| +// Changes the initial login status before TestSystemTrayDelegate is created.
|
| +// Allows testing the case when chrome is restarted right after login (such as
|
| +// when a flag is set).
|
| +class ScopedInitialLoginStatus {
|
| + public:
|
| + explicit ScopedInitialLoginStatus(LoginStatus status);
|
| + ~ScopedInitialLoginStatus();
|
| +
|
| + private:
|
| + LoginStatus old_status_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ScopedInitialLoginStatus);
|
| +};
|
| +
|
| } // namespace test
|
| } // namespace ash
|
|
|
|
|