OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/display/resolution_notification_controller.h" | 5 #include "ash/display/resolution_notification_controller.h" |
6 | 6 |
7 #include "ash/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
8 #include "ash/screen_util.h" | 8 #include "ash/screen_util.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 message_center::MessageCenter::Get()->ClickOnNotificationButton( | 116 message_center::MessageCenter::Get()->ClickOnNotificationButton( |
117 ResolutionNotificationController::kNotificationId, index); | 117 ResolutionNotificationController::kNotificationId, index); |
118 } | 118 } |
119 | 119 |
120 static void CloseNotification() { | 120 static void CloseNotification() { |
121 message_center::MessageCenter::Get()->RemoveNotification( | 121 message_center::MessageCenter::Get()->RemoveNotification( |
122 ResolutionNotificationController::kNotificationId, true /* by_user */); | 122 ResolutionNotificationController::kNotificationId, true /* by_user */); |
123 } | 123 } |
124 | 124 |
125 static bool IsNotificationVisible() { | 125 static bool IsNotificationVisible() { |
126 return message_center::MessageCenter::Get()->HasNotification( | 126 return message_center::MessageCenter::Get()->FindVisibleNotificationById( |
127 ResolutionNotificationController::kNotificationId); | 127 ResolutionNotificationController::kNotificationId) != NULL; |
James Cook
2014/06/09 22:10:23
No need for comparison to NULL here or anywhere el
juyik
2014/06/09 22:46:41
Done.
| |
128 } | 128 } |
129 | 129 |
130 static void TickTimer() { | 130 static void TickTimer() { |
131 controller()->OnTimerTick(); | 131 controller()->OnTimerTick(); |
132 } | 132 } |
133 | 133 |
134 static ResolutionNotificationController* controller() { | 134 static ResolutionNotificationController* controller() { |
135 return Shell::GetInstance()->resolution_notification_controller(); | 135 return Shell::GetInstance()->resolution_notification_controller(); |
136 } | 136 } |
137 | 137 |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
404 ClickOnNotificationButton(0); | 404 ClickOnNotificationButton(0); |
405 RunAllPendingInMessageLoop(); | 405 RunAllPendingInMessageLoop(); |
406 EXPECT_FALSE(IsNotificationVisible()); | 406 EXPECT_FALSE(IsNotificationVisible()); |
407 EXPECT_EQ(0, accept_count()); | 407 EXPECT_EQ(0, accept_count()); |
408 EXPECT_TRUE(display_manager->GetSelectedModeForDisplayId(id2, &mode)); | 408 EXPECT_TRUE(display_manager->GetSelectedModeForDisplayId(id2, &mode)); |
409 EXPECT_EQ("250x250", mode.size.ToString()); | 409 EXPECT_EQ("250x250", mode.size.ToString()); |
410 EXPECT_EQ(58.0f, mode.refresh_rate); | 410 EXPECT_EQ(58.0f, mode.refresh_rate); |
411 } | 411 } |
412 | 412 |
413 } // namespace ash | 413 } // namespace ash |
OLD | NEW |