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

Unified Diff: ash/common/test/test_system_tray_delegate.h

Issue 2420783002: mustash: Convert TraySupervisedUserTest to AshTest (Closed)
Patch Set: rebase Created 4 years, 2 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
« no previous file with comments | « ash/common/test/ash_test.cc ('k') | ash/common/test/test_system_tray_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ash/common/test/ash_test.cc ('k') | ash/common/test/test_system_tray_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698