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

Unified Diff: ash/common/system/chromeos/supervised/tray_supervised_user_unittest.cc

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/BUILD.gn ('k') | ash/common/test/ash_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/chromeos/supervised/tray_supervised_user_unittest.cc
diff --git a/ash/common/system/chromeos/supervised/tray_supervised_user_unittest.cc b/ash/common/system/chromeos/supervised/tray_supervised_user_unittest.cc
index 4d1ff167dc549c2181621cfc4ad54c4851640895..7ccb5a869a7daa0c5f5283dadfd7f0af743e0614 100644
--- a/ash/common/system/chromeos/supervised/tray_supervised_user_unittest.cc
+++ b/ash/common/system/chromeos/supervised/tray_supervised_user_unittest.cc
@@ -5,8 +5,8 @@
#include "ash/common/system/chromeos/supervised/tray_supervised_user.h"
#include "ash/common/login_status.h"
+#include "ash/common/test/ash_test.h"
#include "ash/common/test/test_system_tray_delegate.h"
-#include "ash/test/ash_test_base.h"
#include "ui/message_center/message_center.h"
#include "ui/message_center/notification.h"
#include "ui/message_center/notification_list.h"
@@ -16,7 +16,7 @@ using message_center::NotificationList;
namespace ash {
-class TraySupervisedUserTest : public test::AshTestBase {
+class TraySupervisedUserTest : public AshTest {
public:
TraySupervisedUserTest() {}
~TraySupervisedUserTest() override {}
@@ -42,26 +42,18 @@ message_center::Notification* TraySupervisedUserTest::GetPopup() {
class TraySupervisedUserInitialTest : public TraySupervisedUserTest {
public:
- TraySupervisedUserInitialTest() {}
+ // Set the initial login status to supervised-user before AshTest::SetUp()
+ // constructs the system tray.
+ TraySupervisedUserInitialTest()
+ : scoped_initial_login_status_(LoginStatus::SUPERVISED) {}
~TraySupervisedUserInitialTest() override {}
- void SetUp() override;
- void TearDown() override;
-
private:
+ test::ScopedInitialLoginStatus scoped_initial_login_status_;
+
DISALLOW_COPY_AND_ASSIGN(TraySupervisedUserInitialTest);
};
-void TraySupervisedUserInitialTest::SetUp() {
- test::TestSystemTrayDelegate::SetInitialLoginStatus(LoginStatus::SUPERVISED);
- test::AshTestBase::SetUp();
-}
-
-void TraySupervisedUserInitialTest::TearDown() {
- test::AshTestBase::TearDown();
- // SetInitialLoginStatus() is reset in AshTestHelper::TearDown().
-}
-
TEST_F(TraySupervisedUserTest, SupervisedUserHasNotification) {
test::TestSystemTrayDelegate* delegate = GetSystemTrayDelegate();
delegate->SetLoginStatus(LoginStatus::SUPERVISED);
« no previous file with comments | « ash/common/BUILD.gn ('k') | ash/common/test/ash_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698