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

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

Issue 2108403004: mash: Move several chromeos system tray items to //ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@audio
Patch Set: Rebase Created 4 years, 6 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/system/chromeos/supervised/tray_supervised_user.cc ('k') | ash/system/chromeos/tray_caps_lock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/supervised/tray_supervised_user_unittest.cc
diff --git a/ash/system/chromeos/supervised/tray_supervised_user_unittest.cc b/ash/system/chromeos/supervised/tray_supervised_user_unittest.cc
deleted file mode 100644
index 4fe234fe9d898f60eb88b2809345bdd552441905..0000000000000000000000000000000000000000
--- a/ash/system/chromeos/supervised/tray_supervised_user_unittest.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/system/chromeos/supervised/tray_supervised_user.h"
-
-#include "ash/common/login_status.h"
-#include "ash/test/ash_test_base.h"
-#include "ash/test/test_system_tray_delegate.h"
-#include "ui/message_center/message_center.h"
-#include "ui/message_center/notification.h"
-#include "ui/message_center/notification_list.h"
-#include "ui/message_center/notification_types.h"
-
-using message_center::NotificationList;
-
-namespace ash {
-
-class TraySupervisedUserTest : public test::AshTestBase {
- public:
- TraySupervisedUserTest() {}
- ~TraySupervisedUserTest() override {}
-
- protected:
- message_center::Notification* GetPopup();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TraySupervisedUserTest);
-};
-
-message_center::Notification* TraySupervisedUserTest::GetPopup() {
- NotificationList::PopupNotifications popups =
- message_center::MessageCenter::Get()->GetPopupNotifications();
- for (NotificationList::PopupNotifications::const_iterator iter =
- popups.begin();
- iter != popups.end(); ++iter) {
- if ((*iter)->id() == TraySupervisedUser::kNotificationId)
- return *iter;
- }
- return NULL;
-}
-
-class TraySupervisedUserInitialTest : public TraySupervisedUserTest {
- public:
- TraySupervisedUserInitialTest() {}
- ~TraySupervisedUserInitialTest() override {}
-
- void SetUp() override;
- void TearDown() override;
-
- private:
- 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);
-
- message_center::Notification* notification = GetPopup();
- ASSERT_NE(static_cast<message_center::Notification*>(NULL), notification);
- EXPECT_EQ(static_cast<int>(message_center::SYSTEM_PRIORITY),
- notification->rich_notification_data().priority);
-}
-
-TEST_F(TraySupervisedUserInitialTest, SupervisedUserNoCrash) {
- // Initial login status is already SUPERVISED, which should create
- // the notification and should not cause crashes.
- message_center::Notification* notification = GetPopup();
- ASSERT_NE(static_cast<message_center::Notification*>(NULL), notification);
- EXPECT_EQ(static_cast<int>(message_center::SYSTEM_PRIORITY),
- notification->rich_notification_data().priority);
-}
-
-} // namespace ash
« no previous file with comments | « ash/system/chromeos/supervised/tray_supervised_user.cc ('k') | ash/system/chromeos/tray_caps_lock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698