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

Unified Diff: ash/display/display_manager_unittest.cc

Issue 948583005: Add more tests for mouse rotation,scale&position after display change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: ash/display/display_manager_unittest.cc
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc
index ae5c192764b2419ec4d5fba84efac8a88988b5dd..983f22b894227b8bfc4ca24fe42bbcb51e36c886 100644
--- a/ash/display/display_manager_unittest.cc
+++ b/ash/display/display_manager_unittest.cc
@@ -700,90 +700,6 @@ TEST_F(DisplayManagerTest, MAYBE_TestNativeDisplaysChangedNoInternal) {
GetBounds().size().ToString());
}
-#if defined(OS_WIN)
-// Tests that rely on the actual host size/location does not work on windows.
pkotwicz 2015/02/24 18:38:08 I moved these to display_controller_unittests.cc
-#define MAYBE_EnsurePointerInDisplays DISABLED_EnsurePointerInDisplays
-#define MAYBE_EnsurePointerInDisplays_2ndOnLeft DISABLED_EnsurePointerInDisplays_2ndOnLeft
-#else
-#define MAYBE_EnsurePointerInDisplays EnsurePointerInDisplays
-#define MAYBE_EnsurePointerInDisplays_2ndOnLeft EnsurePointerInDisplays_2ndOnLeft
-#endif
-
-TEST_F(DisplayManagerTest, MAYBE_EnsurePointerInDisplays) {
- UpdateDisplay("200x200,300x300");
- aura::Window::Windows root_windows = Shell::GetAllRootWindows();
-
- aura::Env* env = aura::Env::GetInstance();
-
- ui::test::EventGenerator generator(root_windows[0]);
-
- // Set the initial position.
- generator.MoveMouseToInHost(350, 150);
- EXPECT_EQ("350,150", env->last_mouse_location().ToString());
-
- // A mouse pointer will stay in the 2nd display.
- UpdateDisplay("300x300,200x200");
- EXPECT_EQ("450,50", env->last_mouse_location().ToString());
-
- // A mouse pointer will be outside of displays and move to the
- // center of 2nd display.
- UpdateDisplay("300x300,100x100");
- EXPECT_EQ("350,50", env->last_mouse_location().ToString());
-
- // 2nd display was disconnected, and the cursor is
- // now in the 1st display.
- UpdateDisplay("400x400");
- EXPECT_EQ("50,350", env->last_mouse_location().ToString());
-
- // 1st display's resolution has changed, and the mouse pointer is
- // now outside. Move the mouse pointer to the center of 1st display.
- UpdateDisplay("300x300");
- EXPECT_EQ("150,150", env->last_mouse_location().ToString());
-
- // Move the mouse pointer to the bottom of 1st display.
- generator.MoveMouseToInHost(150, 290);
- EXPECT_EQ("150,290", env->last_mouse_location().ToString());
-
- // The mouse pointer is now on 2nd display.
- UpdateDisplay("300x280,200x200");
- EXPECT_EQ("450,10", env->last_mouse_location().ToString());
-}
-
-TEST_F(DisplayManagerTest, MAYBE_EnsurePointerInDisplays_2ndOnLeft) {
- // Set the 2nd display on the left.
- DisplayLayoutStore* layout_store =
- Shell::GetInstance()->display_manager()->layout_store();
- DisplayLayout layout = layout_store->default_display_layout();
- layout.position = DisplayLayout::LEFT;
- layout_store->SetDefaultDisplayLayout(layout);
-
- UpdateDisplay("200x200,300x300");
- aura::Window::Windows root_windows = Shell::GetAllRootWindows();
-
- EXPECT_EQ("-300,0 300x300",
- ScreenUtil::GetSecondaryDisplay().bounds().ToString());
-
- aura::Env* env = aura::Env::GetInstance();
-
- // Set the initial position.
- root_windows[0]->MoveCursorTo(gfx::Point(-150, 250));
- EXPECT_EQ("-150,250", env->last_mouse_location().ToString());
-
- // A mouse pointer will stay in 2nd display.
- UpdateDisplay("300x300,200x300");
- EXPECT_EQ("-50,150", env->last_mouse_location().ToString());
-
- // A mouse pointer will be outside of displays and move to the
- // center of 2nd display.
- UpdateDisplay("300x300,200x100");
- EXPECT_EQ("-100,50", env->last_mouse_location().ToString());
-
- // 2nd display was disconnected. Mouse pointer should move to
- // 1st display.
- UpdateDisplay("300x300");
- EXPECT_EQ("150,150", env->last_mouse_location().ToString());
-}
-
TEST_F(DisplayManagerTest, NativeDisplaysChangedAfterPrimaryChange) {
if (!SupportsMultipleDisplays())
return;

Powered by Google App Engine
This is Rietveld 408576698