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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 int bottom_with_tray = GetPopupWorkAreaBottom(); | 383 int bottom_with_tray = GetPopupWorkAreaBottom(); |
384 EXPECT_GT(bottom_auto_shown, bottom_with_tray); | 384 EXPECT_GT(bottom_auto_shown, bottom_with_tray); |
385 | 385 |
386 // Create tray notification. | 386 // Create tray notification. |
387 GetSystemTray()->ShowNotificationView(test_item); | 387 GetSystemTray()->ShowNotificationView(test_item); |
388 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state()); | 388 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state()); |
389 int bottom_with_tray_notification = GetPopupWorkAreaBottom(); | 389 int bottom_with_tray_notification = GetPopupWorkAreaBottom(); |
390 EXPECT_GT(bottom_with_tray, bottom_with_tray_notification); | 390 EXPECT_GT(bottom_with_tray, bottom_with_tray_notification); |
391 | 391 |
392 // Close the system tray. | 392 // Close the system tray. |
| 393 // TODO(bruthig) This test fails |
393 GetSystemTray()->ClickedOutsideBubble(); | 394 GetSystemTray()->ClickedOutsideBubble(); |
394 shelf->UpdateAutoHideState(); | 395 shelf->UpdateAutoHideState(); |
395 RunAllPendingInMessageLoop(); | 396 RunAllPendingInMessageLoop(); |
396 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 397 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); |
397 int bottom_hidden_with_tray_notification = GetPopupWorkAreaBottom(); | 398 int bottom_hidden_with_tray_notification = GetPopupWorkAreaBottom(); |
398 EXPECT_LT(bottom_with_tray_notification, | 399 EXPECT_LT(bottom_with_tray_notification, |
399 bottom_hidden_with_tray_notification); | 400 bottom_hidden_with_tray_notification); |
400 EXPECT_GT(bottom_auto_hidden, bottom_hidden_with_tray_notification); | 401 EXPECT_GT(bottom_auto_hidden, bottom_hidden_with_tray_notification); |
401 | 402 |
402 // Close the window again, which shows the shelf. | 403 // Close the window again, which shows the shelf. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 int bottom_second = GetPopupWorkAreaBottomForTray(GetSecondaryTray()); | 462 int bottom_second = GetPopupWorkAreaBottomForTray(GetSecondaryTray()); |
462 | 463 |
463 // System tray is created on the primary display. The popups in the secondary | 464 // System tray is created on the primary display. The popups in the secondary |
464 // tray aren't affected. | 465 // tray aren't affected. |
465 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); | 466 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); |
466 EXPECT_GT(bottom, GetPopupWorkAreaBottom()); | 467 EXPECT_GT(bottom, GetPopupWorkAreaBottom()); |
467 EXPECT_EQ(bottom_second, GetPopupWorkAreaBottomForTray(GetSecondaryTray())); | 468 EXPECT_EQ(bottom_second, GetPopupWorkAreaBottomForTray(GetSecondaryTray())); |
468 } | 469 } |
469 | 470 |
470 } // namespace ash | 471 } // namespace ash |
OLD | NEW |