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

Side by Side Diff: ash/display/display_manager_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: fix gn Created 6 years, 5 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
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/display/display_manager.h" 5 #include "ash/display/display_manager.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/display/display_layout_store.h" 8 #include "ash/display/display_layout_store.h"
9 #include "ash/screen_util.h" 9 #include "ash/screen_util.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
11 #include "ash/test/ash_test_base.h" 11 #include "ash/test/ash_test_base.h"
12 #include "ash/test/display_manager_test_api.h" 12 #include "ash/test/display_manager_test_api.h"
13 #include "ash/test/mirror_window_test_api.h" 13 #include "ash/test/mirror_window_test_api.h"
14 #include "base/format_macros.h" 14 #include "base/format_macros.h"
15 #include "base/strings/string_number_conversions.h" 15 #include "base/strings/string_number_conversions.h"
16 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
17 #include "ui/aura/env.h" 17 #include "ui/aura/env.h"
18 #include "ui/aura/test/event_generator.h"
19 #include "ui/aura/window_observer.h" 18 #include "ui/aura/window_observer.h"
20 #include "ui/aura/window_tree_host.h" 19 #include "ui/aura/window_tree_host.h"
20 #include "ui/events/test/event_generator.h"
21 #include "ui/gfx/display.h"
21 #include "ui/gfx/display_observer.h" 22 #include "ui/gfx/display_observer.h"
22 #include "ui/gfx/display.h"
23 #include "ui/gfx/screen.h" 23 #include "ui/gfx/screen.h"
24 #include "ui/gfx/screen_type_delegate.h" 24 #include "ui/gfx/screen_type_delegate.h"
25 25
26 namespace ash { 26 namespace ash {
27 27
28 using std::vector; 28 using std::vector;
29 using std::string; 29 using std::string;
30 30
31 using base::StringPrintf; 31 using base::StringPrintf;
32 32
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 #define MAYBE_EnsurePointerInDisplays EnsurePointerInDisplays 606 #define MAYBE_EnsurePointerInDisplays EnsurePointerInDisplays
607 #define MAYBE_EnsurePointerInDisplays_2ndOnLeft EnsurePointerInDisplays_2ndOnLef t 607 #define MAYBE_EnsurePointerInDisplays_2ndOnLeft EnsurePointerInDisplays_2ndOnLef t
608 #endif 608 #endif
609 609
610 TEST_F(DisplayManagerTest, MAYBE_EnsurePointerInDisplays) { 610 TEST_F(DisplayManagerTest, MAYBE_EnsurePointerInDisplays) {
611 UpdateDisplay("200x200,300x300"); 611 UpdateDisplay("200x200,300x300");
612 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); 612 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
613 613
614 aura::Env* env = aura::Env::GetInstance(); 614 aura::Env* env = aura::Env::GetInstance();
615 615
616 aura::test::EventGenerator generator(root_windows[0]); 616 ui::test::EventGenerator generator(root_windows[0]);
617 617
618 // Set the initial position. 618 // Set the initial position.
619 generator.MoveMouseToInHost(350, 150); 619 generator.MoveMouseToInHost(350, 150);
620 EXPECT_EQ("350,150", env->last_mouse_location().ToString()); 620 EXPECT_EQ("350,150", env->last_mouse_location().ToString());
621 621
622 // A mouse pointer will stay in the 2nd display. 622 // A mouse pointer will stay in the 2nd display.
623 UpdateDisplay("300x300,200x200"); 623 UpdateDisplay("300x300,200x200");
624 EXPECT_EQ("450,50", env->last_mouse_location().ToString()); 624 EXPECT_EQ("450,50", env->last_mouse_location().ToString());
625 625
626 // A mouse pointer will be outside of displays and move to the 626 // A mouse pointer will be outside of displays and move to the
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 #else 1002 #else
1003 #define MAYBE_UpdateMouseCursorAfterRotateZoom UpdateMouseCursorAfterRotateZoom 1003 #define MAYBE_UpdateMouseCursorAfterRotateZoom UpdateMouseCursorAfterRotateZoom
1004 #endif 1004 #endif
1005 1005
1006 TEST_F(DisplayManagerTest, MAYBE_UpdateMouseCursorAfterRotateZoom) { 1006 TEST_F(DisplayManagerTest, MAYBE_UpdateMouseCursorAfterRotateZoom) {
1007 // Make sure just rotating will not change native location. 1007 // Make sure just rotating will not change native location.
1008 UpdateDisplay("300x200,200x150"); 1008 UpdateDisplay("300x200,200x150");
1009 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); 1009 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
1010 aura::Env* env = aura::Env::GetInstance(); 1010 aura::Env* env = aura::Env::GetInstance();
1011 1011
1012 aura::test::EventGenerator generator1(root_windows[0]); 1012 ui::test::EventGenerator generator1(root_windows[0]);
1013 aura::test::EventGenerator generator2(root_windows[1]); 1013 ui::test::EventGenerator generator2(root_windows[1]);
1014 1014
1015 // Test on 1st display. 1015 // Test on 1st display.
1016 generator1.MoveMouseToInHost(150, 50); 1016 generator1.MoveMouseToInHost(150, 50);
1017 EXPECT_EQ("150,50", env->last_mouse_location().ToString()); 1017 EXPECT_EQ("150,50", env->last_mouse_location().ToString());
1018 UpdateDisplay("300x200/r,200x150"); 1018 UpdateDisplay("300x200/r,200x150");
1019 EXPECT_EQ("50,149", env->last_mouse_location().ToString()); 1019 EXPECT_EQ("50,149", env->last_mouse_location().ToString());
1020 1020
1021 // Test on 2nd display. 1021 // Test on 2nd display.
1022 generator2.MoveMouseToInHost(50, 100); 1022 generator2.MoveMouseToInHost(50, 100);
1023 EXPECT_EQ("250,100", env->last_mouse_location().ToString()); 1023 EXPECT_EQ("250,100", env->last_mouse_location().ToString());
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 DISALLOW_COPY_AND_ASSIGN(ScreenShutdownTest); 1271 DISALLOW_COPY_AND_ASSIGN(ScreenShutdownTest);
1272 }; 1272 };
1273 1273
1274 TEST_F(ScreenShutdownTest, ScreenAfterShutdown) { 1274 TEST_F(ScreenShutdownTest, ScreenAfterShutdown) {
1275 if (!SupportsMultipleDisplays()) 1275 if (!SupportsMultipleDisplays())
1276 return; 1276 return;
1277 UpdateDisplay("500x300,800x400"); 1277 UpdateDisplay("500x300,800x400");
1278 } 1278 }
1279 1279
1280 } // namespace ash 1280 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698