diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-01 17:18:35 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-01 17:18:35 +0000 |
commit | 8ce8c73765600b4741a8f48284bd3be437a599da (patch) | |
tree | 460080b04a071d4ccfbe54478a099de3ea54f9dd | |
parent | 9254f60db6f9233782805c37daa762ea50c27058 (diff) | |
download | chromium_src-8ce8c73765600b4741a8f48284bd3be437a599da.zip chromium_src-8ce8c73765600b4741a8f48284bd3be437a599da.tar.gz chromium_src-8ce8c73765600b4741a8f48284bd3be437a599da.tar.bz2 |
Add MoveMouseToInHost to aura::test::EventGenerator
* remove local functions to move the mouse in host coordinates.
* updated tests that should use host coordinates instead of
root.
BUG=none
TEST=covered by tests.
Review URL: https://chromiumcodereview.appspot.com/14293028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197651 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ash/ash_root_window_transformer_unittest.cc | 55 | ||||
-rw-r--r-- | ash/display/display_controller_unittest.cc | 47 | ||||
-rw-r--r-- | ash/display/display_manager_unittest.cc | 18 | ||||
-rw-r--r-- | ui/aura/test/event_generator.cc | 17 | ||||
-rw-r--r-- | ui/aura/test/event_generator.h | 16 |
5 files changed, 82 insertions, 71 deletions
diff --git a/ash/ash_root_window_transformer_unittest.cc b/ash/ash_root_window_transformer_unittest.cc index c4a1d1e..88b97ad 100644 --- a/ash/ash_root_window_transformer_unittest.cc +++ b/ash/ash_root_window_transformer_unittest.cc @@ -115,14 +115,6 @@ float GetStoredUIScale(int64 id) { return Shell::GetInstance()->display_manager()->GetDisplayInfo(id).ui_scale(); } -void MoveMouseToInHostCoord(aura::RootWindow* root_window, - int host_x, - int host_y) { - gfx::Point move_point(host_x, host_y); - ui::MouseEvent mouseev(ui::ET_MOUSE_MOVED, move_point, move_point, 0); - root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouseev); -} - } // namespace typedef test::AshTestBase AshRootWindowTransformerTest; @@ -167,7 +159,7 @@ TEST_F(AshRootWindowTransformerTest, MAYBE_RotateAndMagnify) { EXPECT_EQ("150x200", root_windows[1]->bounds().size().ToString()); EXPECT_EQ("120,0 150x200", ScreenAsh::GetSecondaryDisplay().bounds().ToString()); - generator1.MoveMouseTo(40, 80); + generator1.MoveMouseToInHost(40, 80); EXPECT_EQ("50,90", event_handler.GetLocationAndReset()); EXPECT_EQ("50,90", aura::Env::GetInstance()->last_mouse_location().ToString()); @@ -178,7 +170,7 @@ TEST_F(AshRootWindowTransformerTest, MAYBE_RotateAndMagnify) { display_manager->SetDisplayRotation(display1.id(), gfx::Display::ROTATE_90); // Move the cursor to the center of the first root window. - generator1.MoveMouseTo(59, 100); + generator1.MoveMouseToInHost(59, 100); magnifier->SetEnabled(true); EXPECT_EQ(2.0f, magnifier->GetScale()); @@ -186,7 +178,7 @@ TEST_F(AshRootWindowTransformerTest, MAYBE_RotateAndMagnify) { EXPECT_EQ("150x200", root_windows[1]->bounds().size().ToString()); EXPECT_EQ("200,0 150x200", ScreenAsh::GetSecondaryDisplay().bounds().ToString()); - generator1.MoveMouseTo(39, 120); + generator1.MoveMouseToInHost(39, 120); EXPECT_EQ("110,70", event_handler.GetLocationAndReset()); EXPECT_EQ("110,70", aura::Env::GetInstance()->last_mouse_location().ToString()); @@ -202,14 +194,14 @@ TEST_F(AshRootWindowTransformerTest, MAYBE_RotateAndMagnify) { display_manager->SetDisplayRotation(display2_id, gfx::Display::ROTATE_270); // Move the cursor to the center of the second root window. - generator2.MoveMouseTo(151, 199); + generator2.MoveMouseToInHost(151, 199); magnifier->SetEnabled(true); EXPECT_EQ("200x120", root_windows[0]->bounds().size().ToString()); EXPECT_EQ("200x150", root_windows[1]->bounds().size().ToString()); EXPECT_EQ("50,120 200x150", ScreenAsh::GetSecondaryDisplay().bounds().ToString()); - generator2.MoveMouseTo(172, 219); + generator2.MoveMouseToInHost(172, 219); EXPECT_EQ("95,80", event_handler.GetLocationAndReset()); EXPECT_EQ("169,175", aura::Env::GetInstance()->last_mouse_location().ToString()); @@ -220,7 +212,7 @@ TEST_F(AshRootWindowTransformerTest, MAYBE_RotateAndMagnify) { display_manager->SetDisplayRotation(display1.id(), gfx::Display::ROTATE_180); // Move the cursor to the center of the first root window. - generator1.MoveMouseTo(59, 99); + generator1.MoveMouseToInHost(59, 99); magnifier->SetEnabled(true); EXPECT_EQ("120x200", root_windows[0]->bounds().size().ToString()); @@ -228,7 +220,7 @@ TEST_F(AshRootWindowTransformerTest, MAYBE_RotateAndMagnify) { // Dislay must share at least 100, so the x's offset becomes 20. EXPECT_EQ("20,200 200x150", ScreenAsh::GetSecondaryDisplay().bounds().ToString()); - generator1.MoveMouseTo(39, 59); + generator1.MoveMouseToInHost(39, 59); EXPECT_EQ("70,120", event_handler.GetLocationAndReset()); EXPECT_EQ(gfx::Display::ROTATE_180, GetStoredRotation(display1.id())); EXPECT_EQ(gfx::Display::ROTATE_270, GetStoredRotation(display2_id)); @@ -259,7 +251,7 @@ TEST_F(AshRootWindowTransformerTest, MAYBE_ScaleAndMagnify) { EXPECT_EQ(1.0f, GetStoredUIScale(display2.id())); aura::test::EventGenerator generator(root_windows[0]); - generator.MoveMouseTo(500, 200); + generator.MoveMouseToInHost(500, 200); EXPECT_EQ("299,150", event_handler.GetLocationAndReset()); magnifier->SetEnabled(false); @@ -331,18 +323,19 @@ TEST_F(AshRootWindowTransformerTest, MAYBE_ConvertHostToRootCoords) { EXPECT_EQ("0,0 300x450", root_windows[0]->bounds().ToString()); EXPECT_EQ(1.5f, GetStoredUIScale(display1.id())); - MoveMouseToInHostCoord(root_windows[0], 300, 200); + aura::test::EventGenerator generator(root_windows[0]); + generator.MoveMouseToInHost(300, 200); magnifier->SetEnabled(true); EXPECT_EQ("150,224", event_handler.GetLocationAndReset()); EXPECT_FLOAT_EQ(2.0f, magnifier->GetScale()); - MoveMouseToInHostCoord(root_windows[0], 300, 200); + generator.MoveMouseToInHost(300, 200); EXPECT_EQ("150,224", event_handler.GetLocationAndReset()); - MoveMouseToInHostCoord(root_windows[0], 200, 300); + generator.MoveMouseToInHost(200, 300); EXPECT_EQ("187,261", event_handler.GetLocationAndReset()); - MoveMouseToInHostCoord(root_windows[0], 100, 400); + generator.MoveMouseToInHost(100, 400); EXPECT_EQ("237,299", event_handler.GetLocationAndReset()); - MoveMouseToInHostCoord(root_windows[0], 0, 0); + generator.MoveMouseToInHost(0, 0); EXPECT_EQ("137,348", event_handler.GetLocationAndReset()); magnifier->SetEnabled(false); @@ -356,18 +349,18 @@ TEST_F(AshRootWindowTransformerTest, MAYBE_ConvertHostToRootCoords) { EXPECT_EQ("0,0 450x300", root_windows[0]->bounds().ToString()); EXPECT_EQ(1.5f, GetStoredUIScale(display1.id())); - MoveMouseToInHostCoord(root_windows[0], 300, 200); + generator.MoveMouseToInHost(300, 200); magnifier->SetEnabled(true); EXPECT_EQ("224,149", event_handler.GetLocationAndReset()); EXPECT_FLOAT_EQ(2.0f, magnifier->GetScale()); - MoveMouseToInHostCoord(root_windows[0], 300, 200); + generator.MoveMouseToInHost(300, 200); EXPECT_EQ("224,148", event_handler.GetLocationAndReset()); - MoveMouseToInHostCoord(root_windows[0], 200, 300); + generator.MoveMouseToInHost(200, 300); EXPECT_EQ("261,111", event_handler.GetLocationAndReset()); - MoveMouseToInHostCoord(root_windows[0], 100, 400); + generator.MoveMouseToInHost(100, 400); EXPECT_EQ("299,60", event_handler.GetLocationAndReset()); - MoveMouseToInHostCoord(root_windows[0], 0, 0); + generator.MoveMouseToInHost(0, 0); EXPECT_EQ("348,159", event_handler.GetLocationAndReset()); magnifier->SetEnabled(false); @@ -381,18 +374,18 @@ TEST_F(AshRootWindowTransformerTest, MAYBE_ConvertHostToRootCoords) { EXPECT_EQ("0,0 300x450", root_windows[0]->bounds().ToString()); EXPECT_EQ(1.5f, GetStoredUIScale(display1.id())); - MoveMouseToInHostCoord(root_windows[0], 300, 200); + generator.MoveMouseToInHost(300, 200); magnifier->SetEnabled(true); EXPECT_EQ("149,225", event_handler.GetLocationAndReset()); EXPECT_FLOAT_EQ(2.0f, magnifier->GetScale()); - MoveMouseToInHostCoord(root_windows[0], 300, 200); + generator.MoveMouseToInHost(300, 200); EXPECT_EQ("148,224", event_handler.GetLocationAndReset()); - MoveMouseToInHostCoord(root_windows[0], 200, 300); + generator.MoveMouseToInHost(200, 300); EXPECT_EQ("111,187", event_handler.GetLocationAndReset()); - MoveMouseToInHostCoord(root_windows[0], 100, 400); + generator.MoveMouseToInHost(100, 400); EXPECT_EQ("60,149", event_handler.GetLocationAndReset()); - MoveMouseToInHostCoord(root_windows[0], 0, 0); + generator.MoveMouseToInHost(0, 0); EXPECT_EQ("159,99", event_handler.GetLocationAndReset()); magnifier->SetEnabled(false); diff --git a/ash/display/display_controller_unittest.cc b/ash/display/display_controller_unittest.cc index 84f615f..c0bbd63 100644 --- a/ash/display/display_controller_unittest.cc +++ b/ash/display/display_controller_unittest.cc @@ -181,14 +181,6 @@ float GetStoredUIScale(int64 id) { return Shell::GetInstance()->display_manager()->GetDisplayInfo(id).ui_scale(); } -void MoveMouseToInHostCoord(aura::RootWindow* root_window, - int host_x, - int host_y) { - gfx::Point move_point(host_x, host_y); - ui::MouseEvent mouseev(ui::ET_MOUSE_MOVED, move_point, move_point, 0); - root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouseev); -} - } // namespace typedef test::AshTestBase DisplayControllerTest; @@ -715,7 +707,7 @@ TEST_F(DisplayControllerTest, MAYBE_OverscanInsets) { ScreenAsh::GetSecondaryDisplay().bounds().ToString()); aura::test::EventGenerator generator(root_windows[0]); - generator.MoveMouseTo(20, 25); + generator.MoveMouseToInHost(20, 25); EXPECT_EQ("5,15", event_handler.GetLocationAndReset()); display_controller->ClearCustomOverscanInsets(display1.id()); @@ -723,7 +715,7 @@ TEST_F(DisplayControllerTest, MAYBE_OverscanInsets) { EXPECT_EQ("120,0 150x200", ScreenAsh::GetSecondaryDisplay().bounds().ToString()); - generator.MoveMouseTo(30, 20); + generator.MoveMouseToInHost(30, 20); EXPECT_EQ("30,20", event_handler.GetLocationAndReset()); Shell::GetInstance()->RemovePreTargetHandler(&event_handler); @@ -762,7 +754,7 @@ TEST_F(DisplayControllerTest, MAYBE_Rotate) { EXPECT_EQ("150x200", root_windows[1]->bounds().size().ToString()); EXPECT_EQ("120,0 150x200", ScreenAsh::GetSecondaryDisplay().bounds().ToString()); - generator1.MoveMouseTo(50, 40); + generator1.MoveMouseToInHost(50, 40); EXPECT_EQ("50,40", event_handler.GetLocationAndReset()); EXPECT_EQ(gfx::Display::ROTATE_0, GetStoredRotation(display1.id())); EXPECT_EQ(gfx::Display::ROTATE_0, GetStoredRotation(display2_id)); @@ -773,7 +765,7 @@ TEST_F(DisplayControllerTest, MAYBE_Rotate) { EXPECT_EQ("150x200", root_windows[1]->bounds().size().ToString()); EXPECT_EQ("200,0 150x200", ScreenAsh::GetSecondaryDisplay().bounds().ToString()); - generator1.MoveMouseTo(50, 40); + generator1.MoveMouseToInHost(50, 40); EXPECT_EQ("40,69", event_handler.GetLocationAndReset()); EXPECT_EQ(gfx::Display::ROTATE_90, GetStoredRotation(display1.id())); EXPECT_EQ(gfx::Display::ROTATE_0, GetStoredRotation(display2_id)); @@ -793,7 +785,7 @@ TEST_F(DisplayControllerTest, MAYBE_Rotate) { EXPECT_EQ(gfx::Display::ROTATE_270, GetStoredRotation(display2_id)); aura::test::EventGenerator generator2(root_windows[1]); - generator2.MoveMouseTo(50, 40); + generator2.MoveMouseToInHost(50, 40); EXPECT_EQ("179,25", event_handler.GetLocationAndReset()); display_manager->SetDisplayRotation(display1.id(), gfx::Display::ROTATE_180); @@ -806,7 +798,7 @@ TEST_F(DisplayControllerTest, MAYBE_Rotate) { EXPECT_EQ(gfx::Display::ROTATE_180, GetStoredRotation(display1.id())); EXPECT_EQ(gfx::Display::ROTATE_270, GetStoredRotation(display2_id)); - generator1.MoveMouseTo(50, 40); + generator1.MoveMouseToInHost(50, 40); EXPECT_EQ("69,159", event_handler.GetLocationAndReset()); Shell::GetInstance()->RemovePreTargetHandler(&event_handler); @@ -830,7 +822,7 @@ TEST_F(DisplayControllerTest, MAYBE_ScaleRootWindow) { EXPECT_EQ(1.0f, GetStoredUIScale(display2.id())); aura::test::EventGenerator generator(root_windows[0]); - generator.MoveMouseTo(599, 200); + generator.MoveMouseToInHost(599, 200); EXPECT_EQ("449,150", event_handler.GetLocationAndReset()); internal::DisplayManager* display_manager = @@ -888,13 +880,14 @@ TEST_F(DisplayControllerTest, MAYBE_ConvertHostToRootCoords) { EXPECT_EQ("0,0 300x450", root_windows[0]->bounds().ToString()); EXPECT_EQ(1.5f, GetStoredUIScale(display1.id())); - MoveMouseToInHostCoord(root_windows[0], 0, 0); + aura::test::EventGenerator generator(root_windows[0]); + generator.MoveMouseToInHost(0, 0); EXPECT_EQ("0,449", event_handler.GetLocationAndReset()); - MoveMouseToInHostCoord(root_windows[0], 599, 0); + generator.MoveMouseToInHost(599, 0); EXPECT_EQ("0,0", event_handler.GetLocationAndReset()); - MoveMouseToInHostCoord(root_windows[0], 599, 399); + generator.MoveMouseToInHost(599, 399); EXPECT_EQ("299,0", event_handler.GetLocationAndReset()); - MoveMouseToInHostCoord(root_windows[0], 0, 399); + generator.MoveMouseToInHost(0, 399); EXPECT_EQ("299,449", event_handler.GetLocationAndReset()); UpdateDisplay("600x400*2/u@1.5"); @@ -904,13 +897,13 @@ TEST_F(DisplayControllerTest, MAYBE_ConvertHostToRootCoords) { EXPECT_EQ("0,0 450x300", root_windows[0]->bounds().ToString()); EXPECT_EQ(1.5f, GetStoredUIScale(display1.id())); - MoveMouseToInHostCoord(root_windows[0], 0, 0); + generator.MoveMouseToInHost(0, 0); EXPECT_EQ("449,299", event_handler.GetLocationAndReset()); - MoveMouseToInHostCoord(root_windows[0], 599, 0); + generator.MoveMouseToInHost(599, 0); EXPECT_EQ("0,299", event_handler.GetLocationAndReset()); - MoveMouseToInHostCoord(root_windows[0], 599, 399); + generator.MoveMouseToInHost(599, 399); EXPECT_EQ("0,0", event_handler.GetLocationAndReset()); - MoveMouseToInHostCoord(root_windows[0], 0, 399); + generator.MoveMouseToInHost(0, 399); EXPECT_EQ("449,0", event_handler.GetLocationAndReset()); UpdateDisplay("600x400*2/l@1.5"); @@ -920,13 +913,13 @@ TEST_F(DisplayControllerTest, MAYBE_ConvertHostToRootCoords) { EXPECT_EQ("0,0 300x450", root_windows[0]->bounds().ToString()); EXPECT_EQ(1.5f, GetStoredUIScale(display1.id())); - MoveMouseToInHostCoord(root_windows[0], 0, 0); + generator.MoveMouseToInHost(0, 0); EXPECT_EQ("299,0", event_handler.GetLocationAndReset()); - MoveMouseToInHostCoord(root_windows[0], 599, 0); + generator.MoveMouseToInHost(599, 0); EXPECT_EQ("299,449", event_handler.GetLocationAndReset()); - MoveMouseToInHostCoord(root_windows[0], 599, 399); + generator.MoveMouseToInHost(599, 399); EXPECT_EQ("0,449", event_handler.GetLocationAndReset()); - MoveMouseToInHostCoord(root_windows[0], 0, 399); + generator.MoveMouseToInHost(0, 399); EXPECT_EQ("0,0", event_handler.GetLocationAndReset()); Shell::GetInstance()->RemovePreTargetHandler(&event_handler); diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc index 66ad123..6fe5deb 100644 --- a/ash/display/display_manager_unittest.cc +++ b/ash/display/display_manager_unittest.cc @@ -13,6 +13,7 @@ #include "base/stringprintf.h" #include "ui/aura/env.h" #include "ui/aura/root_window.h" +#include "ui/aura/test/event_generator.h" #include "ui/aura/window_observer.h" #include "ui/gfx/display_observer.h" #include "ui/gfx/display.h" @@ -557,8 +558,10 @@ TEST_F(DisplayManagerTest, EnsurePointerInDisplays) { aura::Env* env = aura::Env::GetInstance(); + aura::test::EventGenerator generator(root_windows[0]); + // Set the initial position. - root_windows[0]->MoveCursorTo(gfx::Point(350, 150)); + generator.MoveMouseToInHost(350, 150); EXPECT_EQ("350,150", env->last_mouse_location().ToString()); // A mouse pointer will be inside 2nd display. @@ -581,7 +584,7 @@ TEST_F(DisplayManagerTest, EnsurePointerInDisplays) { EXPECT_EQ("150,150", env->last_mouse_location().ToString()); // Move the mouse pointer to the bottom of 1st display. - root_windows[0]->MoveCursorTo(gfx::Point(150, 290)); + generator.MoveMouseToInHost(150, 290); EXPECT_EQ("150,290", env->last_mouse_location().ToString()); // The mouse pointer is outside and closest display is 1st one. @@ -796,14 +799,17 @@ TEST_F(DisplayManagerTest, MAYBE_UpdateMouseCursorAfterRotateZoom) { Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); aura::Env* env = aura::Env::GetInstance(); + aura::test::EventGenerator generator1(root_windows[0]); + aura::test::EventGenerator generator2(root_windows[1]); + // Test on 1st display. - root_windows[0]->MoveCursorTo(gfx::Point(150, 50)); + generator1.MoveMouseToInHost(150, 50); EXPECT_EQ("150,50", env->last_mouse_location().ToString()); UpdateDisplay("300x200/r,200x150"); EXPECT_EQ("50,149", env->last_mouse_location().ToString()); // Test on 2nd display. - root_windows[1]->MoveCursorTo(gfx::Point(50, 100)); + generator2.MoveMouseToInHost(50, 100); EXPECT_EQ("250,100", env->last_mouse_location().ToString()); UpdateDisplay("300x200/r,200x150/l"); EXPECT_EQ("249,50", env->last_mouse_location().ToString()); @@ -812,14 +818,14 @@ TEST_F(DisplayManagerTest, MAYBE_UpdateMouseCursorAfterRotateZoom) { UpdateDisplay("600x400*2,400x300"); // Test on 1st display. - root_windows[0]->MoveCursorTo(gfx::Point(100, 150)); + generator1.MoveMouseToInHost(200, 300); EXPECT_EQ("100,150", env->last_mouse_location().ToString()); UpdateDisplay("600x400*2@1.5,400x300"); EXPECT_EQ("150,225", env->last_mouse_location().ToString()); // Test on 2nd display. UpdateDisplay("600x400,400x300*2"); - root_windows[1]->MoveCursorTo(gfx::Point(100, 50)); + generator2.MoveMouseToInHost(200, 100); EXPECT_EQ("700,50", env->last_mouse_location().ToString()); UpdateDisplay("600x400,400x300*2@1.5"); EXPECT_EQ("750,75", env->last_mouse_location().ToString()); diff --git a/ui/aura/test/event_generator.cc b/ui/aura/test/event_generator.cc index b9728b9..6c03a49 100644 --- a/ui/aura/test/event_generator.cc +++ b/ui/aura/test/event_generator.cc @@ -145,12 +145,23 @@ void EventGenerator::ReleaseRightButton() { ReleaseButton(ui::EF_RIGHT_MOUSE_BUTTON); } -void EventGenerator::MoveMouseTo(const gfx::Point& point, int count) { +void EventGenerator::MoveMouseToInHost(const gfx::Point& point_in_host) { + const ui::EventType event_type = (flags_ & ui::EF_LEFT_MOUSE_BUTTON) ? + ui::ET_MOUSE_DRAGGED : ui::ET_MOUSE_MOVED; + ui::MouseEvent mouseev(event_type, point_in_host, point_in_host, flags_); + Dispatch(&mouseev); + + current_location_ = point_in_host; + current_root_window_->ConvertPointFromHost(¤t_location_); +} + +void EventGenerator::MoveMouseTo(const gfx::Point& point_in_screen, + int count) { DCHECK_GT(count, 0); const ui::EventType event_type = (flags_ & ui::EF_LEFT_MOUSE_BUTTON) ? ui::ET_MOUSE_DRAGGED : ui::ET_MOUSE_MOVED; - gfx::Vector2dF diff(point - current_location_); + gfx::Vector2dF diff(point_in_screen - current_location_); for (float i = 1; i <= count; i++) { gfx::Vector2dF step(diff); step.Scale(i / count); @@ -161,7 +172,7 @@ void EventGenerator::MoveMouseTo(const gfx::Point& point, int count) { ui::MouseEvent mouseev(event_type, move_point, move_point, flags_); Dispatch(&mouseev); } - current_location_ = point; + current_location_ = point_in_screen; } void EventGenerator::MoveMouseRelativeTo(const Window* window, diff --git a/ui/aura/test/event_generator.h b/ui/aura/test/event_generator.h index 46fc8ff..1256e1b 100644 --- a/ui/aura/test/event_generator.h +++ b/ui/aura/test/event_generator.h @@ -111,10 +111,18 @@ class EventGenerator { // Generates a right button release event. void ReleaseRightButton(); - // Generates events to move mouse to be the given |point|. - void MoveMouseTo(const gfx::Point& point, int count); - void MoveMouseTo(const gfx::Point& point) { - MoveMouseTo(point, 1); + // Generates events to move mouse to be the given |point| in the + // |current_root_window_|'s host window coordinates. + void MoveMouseToInHost(const gfx::Point& point_in_host); + void MoveMouseToInHost(int x, int y) { + MoveMouseToInHost(gfx::Point(x, y)); + } + + // Generates events to move mouse to be the given |point| in screen + // coordinates. + void MoveMouseTo(const gfx::Point& point_in_screen, int count); + void MoveMouseTo(const gfx::Point& point_in_screen) { + MoveMouseTo(point_in_screen, 1); } void MoveMouseTo(int x, int y) { MoveMouseTo(gfx::Point(x, y)); |