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

Side by Side Diff: ash/display/resolution_notification_controller_unittest.cc

Issue 324583002: The 1st patch to disambiguate message center notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | ash/system/chromeos/managed/tray_locally_managed_user.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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);
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 }
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « no previous file | ash/system/chromeos/managed/tray_locally_managed_user.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698