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 <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 | 429 |
430 // The work area for auto-hidden status of fullscreen is a bit larger | 430 // The work area for auto-hidden status of fullscreen is a bit larger |
431 // since it doesn't even have the 3-pixel width. | 431 // since it doesn't even have the 3-pixel width. |
432 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 432 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); |
433 int bottom_fullscreen_hidden = GetPopupWorkAreaBottom(); | 433 int bottom_fullscreen_hidden = GetPopupWorkAreaBottom(); |
434 EXPECT_EQ(bottom_auto_hidden, bottom_fullscreen_hidden); | 434 EXPECT_EQ(bottom_auto_hidden, bottom_fullscreen_hidden); |
435 | 435 |
436 // Move the mouse cursor at the bottom, which shows the shelf. | 436 // Move the mouse cursor at the bottom, which shows the shelf. |
437 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); | 437 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); |
438 gfx::Point bottom_right = | 438 gfx::Point bottom_right = |
439 Shell::GetScreen()->GetPrimaryDisplay().bounds().bottom_right(); | 439 gfx::Screen::GetScreen()->GetPrimaryDisplay().bounds().bottom_right(); |
440 bottom_right.Offset(-1, -1); | 440 bottom_right.Offset(-1, -1); |
441 generator.MoveMouseTo(bottom_right); | 441 generator.MoveMouseTo(bottom_right); |
442 shelf->UpdateAutoHideStateNow(); | 442 shelf->UpdateAutoHideStateNow(); |
443 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state()); | 443 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state()); |
444 EXPECT_EQ(bottom, GetPopupWorkAreaBottom()); | 444 EXPECT_EQ(bottom, GetPopupWorkAreaBottom()); |
445 | 445 |
446 generator.MoveMouseTo( | 446 generator.MoveMouseTo( |
447 Shell::GetScreen()->GetPrimaryDisplay().bounds().CenterPoint()); | 447 gfx::Screen::GetScreen()->GetPrimaryDisplay().bounds().CenterPoint()); |
448 shelf->UpdateAutoHideStateNow(); | 448 shelf->UpdateAutoHideStateNow(); |
449 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 449 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); |
450 EXPECT_EQ(bottom_auto_hidden, GetPopupWorkAreaBottom()); | 450 EXPECT_EQ(bottom_auto_hidden, GetPopupWorkAreaBottom()); |
451 } | 451 } |
452 | 452 |
453 TEST_F(WebNotificationTrayTest, MAYBE_PopupAndSystemTrayMultiDisplay) { | 453 TEST_F(WebNotificationTrayTest, MAYBE_PopupAndSystemTrayMultiDisplay) { |
454 UpdateDisplay("800x600,600x400"); | 454 UpdateDisplay("800x600,600x400"); |
455 | 455 |
456 AddNotification("test_id"); | 456 AddNotification("test_id"); |
457 int bottom = GetPopupWorkAreaBottom(); | 457 int bottom = GetPopupWorkAreaBottom(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 ui::TouchEvent release(ui::ET_TOUCH_RELEASED, out_of_bounds, touch_id, | 522 ui::TouchEvent release(ui::ET_TOUCH_RELEASED, out_of_bounds, touch_id, |
523 move.time_stamp()+base::TimeDelta::FromMilliseconds(50)); | 523 move.time_stamp()+base::TimeDelta::FromMilliseconds(50)); |
524 generator.Dispatch(&release); | 524 generator.Dispatch(&release); |
525 EXPECT_FALSE(tray->draw_background_as_active()); | 525 EXPECT_FALSE(tray->draw_background_as_active()); |
526 EXPECT_FALSE(tray->IsMessageCenterBubbleVisible()); | 526 EXPECT_FALSE(tray->IsMessageCenterBubbleVisible()); |
527 } | 527 } |
528 | 528 |
529 #endif // OS_CHROMEOS | 529 #endif // OS_CHROMEOS |
530 | 530 |
531 } // namespace ash | 531 } // namespace ash |
OLD | NEW |