summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/automation/automation_messages_internal.h17
-rw-r--r--chrome/test/automation/window_proxy.cc4
-rw-r--r--chrome/test/automation/window_proxy.h5
-rw-r--r--chrome/test/ui/history_uitest.cc11
4 files changed, 24 insertions, 13 deletions
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h
index b2b3f02..46bb160 100644
--- a/chrome/test/automation/automation_messages_internal.h
+++ b/chrome/test/automation/automation_messages_internal.h
@@ -12,6 +12,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/gfx/point.h"
#include "base/gfx/rect.h"
#include "base/string16.h"
#include "chrome/common/navigation_types.h"
@@ -389,16 +390,20 @@ IPC_BEGIN_MESSAGES(Automation)
int /* AutocompleteEdit handle */)
#if defined(OS_WIN)
- // TODO(port): Port this message.
+ // TODO(estade): This message is defined later on for Mac and Linux. This is
+ // to avoid adding a new IPC in the middle for those platforms (see comment
+ // at top). The message is exactly the same, so they should be remerged when
+ // all messages in this file have been made cross-platform (at which point we
+ // will need to check in new reference builds).
//
// This message requests that a mouse click be performed in window coordinate
// space.
// Request:
// int - the handle of the window that's the context for this click
- // POINT - the point to click
+ // gfx::Point - the point to click
// int - the flags which identify the mouse button(s) for the click, as
// defined in chrome/views/event.h
- IPC_MESSAGE_ROUTED3(AutomationMsg_WindowClick, int, POINT, int)
+ IPC_MESSAGE_ROUTED3(AutomationMsg_WindowClick, int, gfx::Point, int)
#endif // defined(OS_WIN)
// This message requests that a key press be performed.
@@ -988,4 +993,10 @@ IPC_BEGIN_MESSAGES(Automation)
IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_GetFilteredInetHitCount,
int /* hit_count */)
+#if defined(OS_LINUX) || defined(OS_MACOSX)
+ // See previous definition of this message for explanation of why it is
+ // defined twice.
+ IPC_MESSAGE_ROUTED3(AutomationMsg_WindowClick, int, gfx::Point, int)
+#endif
+
IPC_END_MESSAGES(Automation)
diff --git a/chrome/test/automation/window_proxy.cc b/chrome/test/automation/window_proxy.cc
index eea1ced..cb672d3 100644
--- a/chrome/test/automation/window_proxy.cc
+++ b/chrome/test/automation/window_proxy.cc
@@ -27,14 +27,14 @@ bool WindowProxy::GetHWND(HWND* handle) const {
return sender_->Send(new AutomationMsg_WindowHWND(0, handle_, handle));
}
+#endif // defined(OS_WIN)
-bool WindowProxy::SimulateOSClick(const POINT& click, int flags) {
+bool WindowProxy::SimulateOSClick(const gfx::Point& click, int flags) {
if (!is_valid()) return false;
return sender_->Send(
new AutomationMsg_WindowClick(0, handle_, click, flags));
}
-#endif // defined(OS_WIN)
bool WindowProxy::GetWindowTitle(string16* text) {
if (!is_valid()) return false;
diff --git a/chrome/test/automation/window_proxy.h b/chrome/test/automation/window_proxy.h
index efbe1ca..0133ff7 100644
--- a/chrome/test/automation/window_proxy.h
+++ b/chrome/test/automation/window_proxy.h
@@ -21,6 +21,7 @@ class BrowserProxy;
class WindowProxy;
namespace gfx {
+ class Point;
class Rect;
}
@@ -41,14 +42,14 @@ class WindowProxy : public AutomationResourceProxy {
// Gets the outermost HWND that corresponds to the given window.
// Returns true if the call was successful.
bool GetHWND(HWND* handle) const;
+#endif // defined(OS_WIN)
// Simulates a click at the OS level. |click| is in the window's coordinates
// and |flags| specifies which buttons are pressed (as defined in
// chrome/views/event.h). Note that this is equivalent to the user moving
// the mouse and pressing the button. So if there is a window on top of this
// window, the top window is clicked.
- bool SimulateOSClick(const POINT& click, int flags);
-#endif // defined(OS_WIN)
+ bool SimulateOSClick(const gfx::Point& click, int flags);
// Get the title of the top level window.
bool GetWindowTitle(string16* text);
diff --git a/chrome/test/ui/history_uitest.cc b/chrome/test/ui/history_uitest.cc
index e2ba8a4..3a65d4f 100644
--- a/chrome/test/ui/history_uitest.cc
+++ b/chrome/test/ui/history_uitest.cc
@@ -93,8 +93,7 @@ TEST_F(HistoryTester, DISABLED_VerifyHistoryLength) {
kTestCompleteSuccess, action_max_timeout_ms());
}
-#if defined(OS_WIN)
-// This test requires simulated mouse click, which is possible only for Windows.
+#if defined(OS_WIN) || defined(OS_LINUX)
TEST_F(HistoryTester, DISABLED_ConsiderRedirectAfterGestureAsUserInitiated) {
// Test the history length for the following page transition.
//
@@ -116,15 +115,15 @@ TEST_F(HistoryTester, DISABLED_ConsiderRedirectAfterGestureAsUserInitiated) {
gfx::Rect tab_view_bounds;
ASSERT_TRUE(window->GetViewBounds(VIEW_ID_TAB_CONTAINER, &tab_view_bounds,
true));
- POINT point(tab_view_bounds.CenterPoint().ToPOINT());
ASSERT_TRUE(
- window->SimulateOSClick(point, views::Event::EF_LEFT_BUTTON_DOWN));
+ window->SimulateOSClick(tab_view_bounds.CenterPoint(),
+ views::Event::EF_LEFT_BUTTON_DOWN));
- NavigateToURL(GURL("javascript:redirectToPage12()"));
+ NavigateToURL(GURL("javascript:redirectToPage12()"));
WaitForFinish("History_Length_Test_12", "1", url, kTestCompleteCookie,
kTestCompleteSuccess, action_max_timeout_ms());
}
-#endif // defined(OS_WIN)
+#endif // defined(OS_WIN) || defined(OS_LINUX)
TEST_F(HistoryTester, DISABLED_ConsiderSlowRedirectAsUserInitiated) {
// Test the history length for the following page transition.