OLD | NEW |
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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 WebNotificationTray* secondary_tray = GetSecondaryTray(); | 283 WebNotificationTray* secondary_tray = GetSecondaryTray(); |
284 ASSERT_TRUE(secondary_tray); | 284 ASSERT_TRUE(secondary_tray); |
285 EXPECT_TRUE(secondary_tray->IsPopupVisible()); | 285 EXPECT_TRUE(secondary_tray->IsPopupVisible()); |
286 | 286 |
287 // Transition to mirroring and then back to extended display, which recreates | 287 // Transition to mirroring and then back to extended display, which recreates |
288 // root window controller and shelf with having notifications. This code | 288 // root window controller and shelf with having notifications. This code |
289 // verifies it doesn't cause crash and popups are still visible. See | 289 // verifies it doesn't cause crash and popups are still visible. See |
290 // http://crbug.com/263664 | 290 // http://crbug.com/263664 |
291 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 291 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
292 | 292 |
293 display_manager->SetSecondDisplayMode(DisplayManager::MIRRORING); | 293 display_manager->SetMultiDisplayMode(DisplayManager::MIRRORING); |
294 UpdateDisplay("400x400,200x200"); | 294 UpdateDisplay("400x400,200x200"); |
295 EXPECT_TRUE(GetTray()->IsPopupVisible()); | 295 EXPECT_TRUE(GetTray()->IsPopupVisible()); |
296 EXPECT_FALSE(GetSecondaryTray()); | 296 EXPECT_FALSE(GetSecondaryTray()); |
297 | 297 |
298 display_manager->SetSecondDisplayMode(DisplayManager::EXTENDED); | 298 display_manager->SetMultiDisplayMode(DisplayManager::EXTENDED); |
299 UpdateDisplay("400x400,200x200"); | 299 UpdateDisplay("400x400,200x200"); |
300 EXPECT_TRUE(GetTray()->IsPopupVisible()); | 300 EXPECT_TRUE(GetTray()->IsPopupVisible()); |
301 secondary_tray = GetSecondaryTray(); | 301 secondary_tray = GetSecondaryTray(); |
302 ASSERT_TRUE(secondary_tray); | 302 ASSERT_TRUE(secondary_tray); |
303 EXPECT_TRUE(secondary_tray->IsPopupVisible()); | 303 EXPECT_TRUE(secondary_tray->IsPopupVisible()); |
304 } | 304 } |
305 | 305 |
306 #if defined(OS_CHROMEOS) | 306 #if defined(OS_CHROMEOS) |
307 // PopupAndSystemTray may fail in platforms other than ChromeOS because the | 307 // PopupAndSystemTray may fail in platforms other than ChromeOS because the |
308 // RootWindow's bound can be bigger than gfx::Display's work area so that | 308 // RootWindow's bound can be bigger than gfx::Display's work area so that |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 ui::TouchEvent release(ui::ET_TOUCH_RELEASED, out_of_bounds, touch_id, | 527 ui::TouchEvent release(ui::ET_TOUCH_RELEASED, out_of_bounds, touch_id, |
528 move.time_stamp()+base::TimeDelta::FromMilliseconds(50)); | 528 move.time_stamp()+base::TimeDelta::FromMilliseconds(50)); |
529 generator.Dispatch(&release); | 529 generator.Dispatch(&release); |
530 EXPECT_FALSE(tray->draw_background_as_active()); | 530 EXPECT_FALSE(tray->draw_background_as_active()); |
531 EXPECT_FALSE(tray->IsMessageCenterBubbleVisible()); | 531 EXPECT_FALSE(tray->IsMessageCenterBubbleVisible()); |
532 } | 532 } |
533 | 533 |
534 #endif // OS_CHROMEOS | 534 #endif // OS_CHROMEOS |
535 | 535 |
536 } // namespace ash | 536 } // namespace ash |
OLD | NEW |