Chromium Code Reviews| 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..8f4f11b24e1e6ba82ab2a4d9c00e01ce7dd2236d 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 a |
|
msw
2016/10/14 16:10:29
nit: "such as when a flag is set" or some better w
James Cook
2016/10/14 16:32:53
Done.
|
| +// flag is set). |
| +class ScopedInitialLoginStatus { |
| + public: |
| + explicit ScopedInitialLoginStatus(LoginStatus status); |
| + ~ScopedInitialLoginStatus(); |
| + |
| + private: |
| + LoginStatus old_status_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ScopedInitialLoginStatus); |
| +}; |
| + |
| } // namespace test |
| } // namespace ash |