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

Side by Side Diff: ash/system/web_notification/web_notification_tray_unittest.cc

Issue 2058173002: mash: Move SystemTrayDelegate ownership to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review feedback 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/web_notification/web_notification_tray.h" 5 #include "ash/system/web_notification/web_notification_tray.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/common/shell_window_ids.h" 10 #include "ash/common/shell_window_ids.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 #define MAYBE_PopupAndSystemTrayMultiDisplay \ 279 #define MAYBE_PopupAndSystemTrayMultiDisplay \
280 DISABLED_PopupAndSystemTrayMultiDisplay 280 DISABLED_PopupAndSystemTrayMultiDisplay
281 #endif 281 #endif
282 282
283 // Verifies if the notification appears on both displays when extended mode. 283 // Verifies if the notification appears on both displays when extended mode.
284 TEST_F(WebNotificationTrayTest, MAYBE_PopupShownOnBothDisplays) { 284 TEST_F(WebNotificationTrayTest, MAYBE_PopupShownOnBothDisplays) {
285 if (!SupportsMultipleDisplays()) 285 if (!SupportsMultipleDisplays())
286 return; 286 return;
287 287
288 // Enables to appear the notification for display changes. 288 // Enables to appear the notification for display changes.
289 test::TestSystemTrayDelegate* tray_delegate = 289 test::TestSystemTrayDelegate* tray_delegate = GetSystemTrayDelegate();
290 static_cast<test::TestSystemTrayDelegate*>(
291 Shell::GetInstance()->system_tray_delegate());
292 tray_delegate->set_should_show_display_notification(true); 290 tray_delegate->set_should_show_display_notification(true);
293 291
294 UpdateDisplay("400x400,200x200"); 292 UpdateDisplay("400x400,200x200");
295 // UpdateDisplay() creates the display notifications, so popup is visible. 293 // UpdateDisplay() creates the display notifications, so popup is visible.
296 EXPECT_TRUE(GetTray()->IsPopupVisible()); 294 EXPECT_TRUE(GetTray()->IsPopupVisible());
297 WebNotificationTray* secondary_tray = GetSecondaryTray(); 295 WebNotificationTray* secondary_tray = GetSecondaryTray();
298 ASSERT_TRUE(secondary_tray); 296 ASSERT_TRUE(secondary_tray);
299 EXPECT_TRUE(secondary_tray->IsPopupVisible()); 297 EXPECT_TRUE(secondary_tray->IsPopupVisible());
300 298
301 // Transition to mirroring and then back to extended display, which recreates 299 // Transition to mirroring and then back to extended display, which recreates
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 ui::TouchEvent release(ui::ET_TOUCH_RELEASED, out_of_bounds, touch_id, 538 ui::TouchEvent release(ui::ET_TOUCH_RELEASED, out_of_bounds, touch_id,
541 move.time_stamp()+base::TimeDelta::FromMilliseconds(50)); 539 move.time_stamp()+base::TimeDelta::FromMilliseconds(50));
542 generator.Dispatch(&release); 540 generator.Dispatch(&release);
543 EXPECT_FALSE(tray->draw_background_as_active()); 541 EXPECT_FALSE(tray->draw_background_as_active());
544 EXPECT_FALSE(tray->IsMessageCenterBubbleVisible()); 542 EXPECT_FALSE(tray->IsMessageCenterBubbleVisible());
545 } 543 }
546 544
547 #endif // OS_CHROMEOS 545 #endif // OS_CHROMEOS
548 546
549 } // namespace ash 547 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698