OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/system/chromeos/supervised/tray_supervised_user.h" | 5 #include "ash/system/chromeos/supervised/tray_supervised_user.h" |
6 | 6 |
7 #include "ash/common/login_status.h" | 7 #include "ash/common/login_status.h" |
8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
9 #include "ash/test/test_system_tray_delegate.h" | 9 #include "ash/test/test_system_tray_delegate.h" |
10 #include "ui/message_center/message_center.h" | 10 #include "ui/message_center/message_center.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 message_center::Notification* GetPopup(); | 25 message_center::Notification* GetPopup(); |
26 | 26 |
27 private: | 27 private: |
28 DISALLOW_COPY_AND_ASSIGN(TraySupervisedUserTest); | 28 DISALLOW_COPY_AND_ASSIGN(TraySupervisedUserTest); |
29 }; | 29 }; |
30 | 30 |
31 message_center::Notification* TraySupervisedUserTest::GetPopup() { | 31 message_center::Notification* TraySupervisedUserTest::GetPopup() { |
32 NotificationList::PopupNotifications popups = | 32 NotificationList::PopupNotifications popups = |
33 message_center::MessageCenter::Get()->GetPopupNotifications(); | 33 message_center::MessageCenter::Get()->GetPopupNotifications(); |
34 for (NotificationList::PopupNotifications::const_iterator iter = | 34 for (NotificationList::PopupNotifications::const_iterator iter = |
35 popups.begin(); iter != popups.end(); ++iter) { | 35 popups.begin(); |
| 36 iter != popups.end(); ++iter) { |
36 if ((*iter)->id() == TraySupervisedUser::kNotificationId) | 37 if ((*iter)->id() == TraySupervisedUser::kNotificationId) |
37 return *iter; | 38 return *iter; |
38 } | 39 } |
39 return NULL; | 40 return NULL; |
40 } | 41 } |
41 | 42 |
42 class TraySupervisedUserInitialTest : public TraySupervisedUserTest { | 43 class TraySupervisedUserInitialTest : public TraySupervisedUserTest { |
43 public: | 44 public: |
44 TraySupervisedUserInitialTest() {} | 45 TraySupervisedUserInitialTest() {} |
45 ~TraySupervisedUserInitialTest() override {} | 46 ~TraySupervisedUserInitialTest() override {} |
(...skipping 28 matching lines...) Expand all Loading... |
74 TEST_F(TraySupervisedUserInitialTest, SupervisedUserNoCrash) { | 75 TEST_F(TraySupervisedUserInitialTest, SupervisedUserNoCrash) { |
75 // Initial login status is already SUPERVISED, which should create | 76 // Initial login status is already SUPERVISED, which should create |
76 // the notification and should not cause crashes. | 77 // the notification and should not cause crashes. |
77 message_center::Notification* notification = GetPopup(); | 78 message_center::Notification* notification = GetPopup(); |
78 ASSERT_NE(static_cast<message_center::Notification*>(NULL), notification); | 79 ASSERT_NE(static_cast<message_center::Notification*>(NULL), notification); |
79 EXPECT_EQ(static_cast<int>(message_center::SYSTEM_PRIORITY), | 80 EXPECT_EQ(static_cast<int>(message_center::SYSTEM_PRIORITY), |
80 notification->rich_notification_data().priority); | 81 notification->rich_notification_data().priority); |
81 } | 82 } |
82 | 83 |
83 } // namespace ash | 84 } // namespace ash |
OLD | NEW |