Index: remoting/test/remote_desktop_browsertest.cc |
diff --git a/remoting/test/remote_desktop_browsertest.cc b/remoting/test/remote_desktop_browsertest.cc |
index 553b57dc58b617f05cfaa3014a6e5648136bc35d..e1dc25a499965488f801a49cc2cdbe402951c5b3 100644 |
--- a/remoting/test/remote_desktop_browsertest.cc |
+++ b/remoting/test/remote_desktop_browsertest.cc |
@@ -281,6 +281,34 @@ void RemoteDesktopBrowserTest::SimulateStringInput(const std::string& input) { |
SimulateCharInput(input[i]); |
} |
+void RemoteDesktopBrowserTest::SimulateMouseLeftClickAt(int x, int y) { |
+ SimulateMouseClickAt(0, WebKit::WebMouseEvent::ButtonLeft, x, y); |
+} |
+ |
+void RemoteDesktopBrowserTest::SimulateMouseClickAt( |
+ int modifiers, WebKit::WebMouseEvent::Button button, int x, int y) { |
+ ExecuteScript( |
+ "var clientPluginElement = " |
+ "document.getElementById('session-client-plugin');" |
+ "var clientPluginRect = clientPluginElement.getBoundingClientRect();"); |
+ |
+ int top = ExecuteScriptAndExtractInt("clientPluginRect.top"); |
+ int left = ExecuteScriptAndExtractInt("clientPluginRect.left"); |
+ int width = ExecuteScriptAndExtractInt("clientPluginRect.width"); |
+ int height = ExecuteScriptAndExtractInt("clientPluginRect.height"); |
+ |
+ ASSERT_GT(x, 0); |
+ ASSERT_LT(x, width); |
+ ASSERT_GT(y, 0); |
+ ASSERT_LT(y, height); |
+ |
+ content::SimulateMouseClickAt( |
+ browser()->tab_strip_model()->GetActiveWebContents(), |
+ modifiers, |
+ button, |
+ gfx::Point(left + x, top + y)); |
+} |
+ |
void RemoteDesktopBrowserTest::Install() { |
// TODO(weitaosu): add support for unpacked extension (the v2 app needs it). |
if (!NoInstall()) { |