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/session/tray_session_length_limit.h" | 5 #include "ash/system/chromeos/session/tray_session_length_limit.h" |
6 | 6 |
7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/system/tray/system_tray.h" | 9 #include "ash/system/tray/system_tray.h" |
10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
11 #include "ash/test/test_system_tray_delegate.h" | 11 #include "ash/test/test_system_tray_delegate.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "ui/message_center/message_center.h" | 13 #include "ui/message_center/message_center.h" |
14 #include "ui/message_center/notification.h" | 14 #include "ui/message_center/notification.h" |
15 #include "ui/message_center/notification_types.h" | 15 #include "ui/message_center/notification_types.h" |
16 | 16 |
17 namespace ash { | 17 namespace ash { |
18 namespace test { | 18 namespace test { |
19 | 19 |
20 class TraySessionLengthLimitTest : public AshTestBase { | 20 class TraySessionLengthLimitTest : public AshTestBase { |
21 public: | 21 public: |
22 TraySessionLengthLimitTest() {} | 22 TraySessionLengthLimitTest() {} |
23 virtual ~TraySessionLengthLimitTest() {} | 23 virtual ~TraySessionLengthLimitTest() {} |
24 | 24 |
25 virtual void SetUp() OVERRIDE { | 25 virtual void SetUp() override { |
26 AshTestBase::SetUp(); | 26 AshTestBase::SetUp(); |
27 SystemTray* system_tray = | 27 SystemTray* system_tray = |
28 Shell::GetPrimaryRootWindowController()->GetSystemTray(); | 28 Shell::GetPrimaryRootWindowController()->GetSystemTray(); |
29 tray_session_length_limit_ = new TraySessionLengthLimit(system_tray); | 29 tray_session_length_limit_ = new TraySessionLengthLimit(system_tray); |
30 system_tray->AddTrayItem(tray_session_length_limit_); | 30 system_tray->AddTrayItem(tray_session_length_limit_); |
31 } | 31 } |
32 | 32 |
33 virtual void TearDown() OVERRIDE { | 33 virtual void TearDown() override { |
34 AshTestBase::TearDown(); | 34 AshTestBase::TearDown(); |
35 } | 35 } |
36 | 36 |
37 protected: | 37 protected: |
38 void UpdateSessionLengthLimitInMin(int mins) { | 38 void UpdateSessionLengthLimitInMin(int mins) { |
39 GetSystemTrayDelegate()->SetSessionLengthLimitForTest( | 39 GetSystemTrayDelegate()->SetSessionLengthLimitForTest( |
40 base::TimeDelta::FromMinutes(mins)); | 40 base::TimeDelta::FromMinutes(mins)); |
41 tray_session_length_limit_->OnSessionLengthLimitChanged(); | 41 tray_session_length_limit_->OnSessionLengthLimitChanged(); |
42 } | 42 } |
43 | 43 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // re-appear and be re-read. | 150 // re-appear and be re-read. |
151 UpdateSessionLengthLimitInMin(15); | 151 UpdateSessionLengthLimitInMin(15); |
152 notification = GetNotification(); | 152 notification = GetNotification(); |
153 EXPECT_TRUE(notification); | 153 EXPECT_TRUE(notification); |
154 EXPECT_TRUE(notification->rich_notification_data(). | 154 EXPECT_TRUE(notification->rich_notification_data(). |
155 should_make_spoken_feedback_for_popup_updates); | 155 should_make_spoken_feedback_for_popup_updates); |
156 } | 156 } |
157 | 157 |
158 } // namespace test | 158 } // namespace test |
159 } // namespace ash | 159 } // namespace ash |
OLD | NEW |