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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 // visible. | 325 // visible. |
326 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); | 326 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); |
327 EXPECT_TRUE(GetTray()->IsPopupVisible()); | 327 EXPECT_TRUE(GetTray()->IsPopupVisible()); |
328 gfx::Rect work_area_with_tray = GetPopupWorkArea(); | 328 gfx::Rect work_area_with_tray = GetPopupWorkArea(); |
329 EXPECT_GT(work_area.size().GetArea(), work_area_with_tray.size().GetArea()); | 329 EXPECT_GT(work_area.size().GetArea(), work_area_with_tray.size().GetArea()); |
330 | 330 |
331 // System tray notification is also created, the popup's work area is narrowed | 331 // System tray notification is also created, the popup's work area is narrowed |
332 // even more, but still visible. | 332 // even more, but still visible. |
333 GetSystemTray()->ShowNotificationView(test_item); | 333 GetSystemTray()->ShowNotificationView(test_item); |
334 EXPECT_TRUE(GetTray()->IsPopupVisible()); | 334 EXPECT_TRUE(GetTray()->IsPopupVisible()); |
335 gfx::Rect work_area_with_tray_notificaiton = GetPopupWorkArea(); | 335 gfx::Rect work_area_with_tray_notification = GetPopupWorkArea(); |
336 EXPECT_GT(work_area.size().GetArea(), | 336 EXPECT_GT(work_area.size().GetArea(), |
337 work_area_with_tray_notificaiton.size().GetArea()); | 337 work_area_with_tray_notification.size().GetArea()); |
338 EXPECT_GT(work_area_with_tray.size().GetArea(), | 338 EXPECT_GT(work_area_with_tray.size().GetArea(), |
339 work_area_with_tray_notificaiton.size().GetArea()); | 339 work_area_with_tray_notification.size().GetArea()); |
340 | 340 |
341 // Close system tray, only system tray notifications. | 341 // Close system tray, only system tray notifications. |
342 GetSystemTray()->ClickedOutsideBubble(); | 342 GetSystemTray()->ClickedOutsideBubble(); |
343 EXPECT_TRUE(GetTray()->IsPopupVisible()); | 343 EXPECT_TRUE(GetTray()->IsPopupVisible()); |
344 gfx::Rect work_area_with_notification = GetPopupWorkArea(); | 344 gfx::Rect work_area_with_notification = GetPopupWorkArea(); |
345 EXPECT_GT(work_area.size().GetArea(), | 345 EXPECT_GT(work_area.size().GetArea(), |
346 work_area_with_notification.size().GetArea()); | 346 work_area_with_notification.size().GetArea()); |
347 EXPECT_LT(work_area_with_tray_notificaiton.size().GetArea(), | 347 EXPECT_LT(work_area_with_tray_notification.size().GetArea(), |
348 work_area_with_notification.size().GetArea()); | 348 work_area_with_notification.size().GetArea()); |
349 | 349 |
350 // Close the system tray notifications. | 350 // Close the system tray notifications. |
351 GetSystemTray()->HideNotificationView(test_item); | 351 GetSystemTray()->HideNotificationView(test_item); |
352 EXPECT_TRUE(GetTray()->IsPopupVisible()); | 352 EXPECT_TRUE(GetTray()->IsPopupVisible()); |
353 EXPECT_EQ(work_area.ToString(), GetPopupWorkArea().ToString()); | 353 EXPECT_EQ(work_area.ToString(), GetPopupWorkArea().ToString()); |
354 } | 354 } |
355 | 355 |
356 TEST_F(WebNotificationTrayTest, MAYBE_PopupAndAutoHideShelf) { | 356 TEST_F(WebNotificationTrayTest, MAYBE_PopupAndAutoHideShelf) { |
357 AddNotification("test_id"); | 357 AddNotification("test_id"); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 | 469 |
470 // System tray is created on the primary display. The popups in the secondary | 470 // System tray is created on the primary display. The popups in the secondary |
471 // tray aren't affected. | 471 // tray aren't affected. |
472 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); | 472 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); |
473 EXPECT_GT(work_area.size().GetArea(), GetPopupWorkArea().size().GetArea()); | 473 EXPECT_GT(work_area.size().GetArea(), GetPopupWorkArea().size().GetArea()); |
474 EXPECT_EQ(work_area_second.ToString(), | 474 EXPECT_EQ(work_area_second.ToString(), |
475 GetPopupWorkAreaForTray(GetSecondaryTray()).ToString()); | 475 GetPopupWorkAreaForTray(GetSecondaryTray()).ToString()); |
476 } | 476 } |
477 | 477 |
478 } // namespace ash | 478 } // namespace ash |
OLD | NEW |