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

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

Issue 406413004: Cleanups for aura/test/event_generator.h (resolve TODOs) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase at r285842 Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « ash/system/user/tray_user_unittest.cc ('k') | ash/test/ash_test_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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"
11 #include "ash/shelf/shelf_layout_manager.h" 11 #include "ash/shelf/shelf_layout_manager.h"
12 #include "ash/shelf/shelf_widget.h" 12 #include "ash/shelf/shelf_widget.h"
13 #include "ash/shell.h" 13 #include "ash/shell.h"
14 #include "ash/system/status_area_widget.h" 14 #include "ash/system/status_area_widget.h"
15 #include "ash/system/tray/system_tray.h" 15 #include "ash/system/tray/system_tray.h"
16 #include "ash/system/tray/system_tray_item.h" 16 #include "ash/system/tray/system_tray_item.h"
17 #include "ash/system/web_notification/ash_popup_alignment_delegate.h" 17 #include "ash/system/web_notification/ash_popup_alignment_delegate.h"
18 #include "ash/test/ash_test_base.h" 18 #include "ash/test/ash_test_base.h"
19 #include "ash/test/status_area_widget_test_helper.h" 19 #include "ash/test/status_area_widget_test_helper.h"
20 #include "ash/test/test_system_tray_delegate.h" 20 #include "ash/test/test_system_tray_delegate.h"
21 #include "ash/wm/window_state.h" 21 #include "ash/wm/window_state.h"
22 #include "base/strings/stringprintf.h" 22 #include "base/strings/stringprintf.h"
23 #include "base/strings/utf_string_conversions.h" 23 #include "base/strings/utf_string_conversions.h"
24 #include "ui/aura/client/aura_constants.h" 24 #include "ui/aura/client/aura_constants.h"
25 #include "ui/aura/test/event_generator.h"
26 #include "ui/aura/window.h" 25 #include "ui/aura/window.h"
26 #include "ui/events/test/event_generator.h"
27 #include "ui/gfx/display.h" 27 #include "ui/gfx/display.h"
28 #include "ui/gfx/screen.h" 28 #include "ui/gfx/screen.h"
29 #include "ui/message_center/message_center_style.h" 29 #include "ui/message_center/message_center_style.h"
30 #include "ui/message_center/message_center_tray.h" 30 #include "ui/message_center/message_center_tray.h"
31 #include "ui/message_center/notification_list.h" 31 #include "ui/message_center/notification_list.h"
32 #include "ui/message_center/notification_types.h" 32 #include "ui/message_center/notification_types.h"
33 #include "ui/message_center/views/message_center_bubble.h" 33 #include "ui/message_center/views/message_center_bubble.h"
34 #include "ui/message_center/views/message_popup_collection.h" 34 #include "ui/message_center/views/message_popup_collection.h"
35 #include "ui/views/controls/label.h" 35 #include "ui/views/controls/label.h"
36 #include "ui/views/layout/fill_layout.h" 36 #include "ui/views/layout/fill_layout.h"
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); 430 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
431 RunAllPendingInMessageLoop(); 431 RunAllPendingInMessageLoop();
432 432
433 // The work area for auto-hidden status of fullscreen is a bit larger 433 // The work area for auto-hidden status of fullscreen is a bit larger
434 // since it doesn't even have the 3-pixel width. 434 // since it doesn't even have the 3-pixel width.
435 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); 435 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
436 int bottom_fullscreen_hidden = GetPopupWorkAreaBottom(); 436 int bottom_fullscreen_hidden = GetPopupWorkAreaBottom();
437 EXPECT_EQ(bottom_auto_hidden, bottom_fullscreen_hidden); 437 EXPECT_EQ(bottom_auto_hidden, bottom_fullscreen_hidden);
438 438
439 // Move the mouse cursor at the bottom, which shows the shelf. 439 // Move the mouse cursor at the bottom, which shows the shelf.
440 aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); 440 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow());
441 gfx::Point bottom_right = 441 gfx::Point bottom_right =
442 Shell::GetScreen()->GetPrimaryDisplay().bounds().bottom_right(); 442 Shell::GetScreen()->GetPrimaryDisplay().bounds().bottom_right();
443 bottom_right.Offset(-1, -1); 443 bottom_right.Offset(-1, -1);
444 generator.MoveMouseTo(bottom_right); 444 generator.MoveMouseTo(bottom_right);
445 shelf->UpdateAutoHideStateNow(); 445 shelf->UpdateAutoHideStateNow();
446 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state()); 446 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
447 EXPECT_EQ(bottom, GetPopupWorkAreaBottom()); 447 EXPECT_EQ(bottom, GetPopupWorkAreaBottom());
448 448
449 generator.MoveMouseTo( 449 generator.MoveMouseTo(
450 Shell::GetScreen()->GetPrimaryDisplay().bounds().CenterPoint()); 450 Shell::GetScreen()->GetPrimaryDisplay().bounds().CenterPoint());
(...skipping 10 matching lines...) Expand all
461 int bottom_second = GetPopupWorkAreaBottomForTray(GetSecondaryTray()); 461 int bottom_second = GetPopupWorkAreaBottomForTray(GetSecondaryTray());
462 462
463 // System tray is created on the primary display. The popups in the secondary 463 // System tray is created on the primary display. The popups in the secondary
464 // tray aren't affected. 464 // tray aren't affected.
465 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); 465 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW);
466 EXPECT_GT(bottom, GetPopupWorkAreaBottom()); 466 EXPECT_GT(bottom, GetPopupWorkAreaBottom());
467 EXPECT_EQ(bottom_second, GetPopupWorkAreaBottomForTray(GetSecondaryTray())); 467 EXPECT_EQ(bottom_second, GetPopupWorkAreaBottomForTray(GetSecondaryTray()));
468 } 468 }
469 469
470 } // namespace ash 470 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/user/tray_user_unittest.cc ('k') | ash/test/ash_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698