summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-11 23:29:59 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-11 23:29:59 +0000
commitaa9387daf0c639b82627dc003237023130a8c693 (patch)
tree7e9645ee84ebbac14e9313e84eb1371c1a84d178 /chrome/test/automation
parent378b4516b5e7970ae1011599ed397b3d03010c7a (diff)
downloadchromium_src-aa9387daf0c639b82627dc003237023130a8c693.zip
chromium_src-aa9387daf0c639b82627dc003237023130a8c693.tar.gz
chromium_src-aa9387daf0c639b82627dc003237023130a8c693.tar.bz2
Get rid of ui_controls.h usage in shipping browser code. In a followup change, I'll move the code to a test directory.
I switched the page_load reliablity test to send synthesized keystrokes instead. I removed the reliablity tag drag tests, since these duplicate the newer interactive_ui_tests. The ChromeDriver method has been deprecated after discussion with kkania. Review URL: https://codereview.chromium.org/11875004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176470 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation')
-rw-r--r--chrome/test/automation/browser_proxy.cc21
-rw-r--r--chrome/test/automation/browser_proxy.h8
-rw-r--r--chrome/test/automation/tab_proxy.cc4
-rw-r--r--chrome/test/automation/tab_proxy.h4
-rw-r--r--chrome/test/automation/window_proxy.cc14
-rw-r--r--chrome/test/automation/window_proxy.h14
6 files changed, 9 insertions, 56 deletions
diff --git a/chrome/test/automation/browser_proxy.cc b/chrome/test/automation/browser_proxy.cc
index 6716da7..eade432c 100644
--- a/chrome/test/automation/browser_proxy.cc
+++ b/chrome/test/automation/browser_proxy.cc
@@ -160,27 +160,6 @@ bool BrowserProxy::ApplyAccelerator(int id) {
return RunCommandAsync(id);
}
-bool BrowserProxy::SimulateDrag(const gfx::Point& start,
- const gfx::Point& end,
- int flags,
- bool press_escape_en_route) {
- if (!is_valid())
- return false;
-
- std::vector<gfx::Point> drag_path;
- drag_path.push_back(start);
- drag_path.push_back(end);
-
- bool result = false;
-
- if (!sender_->Send(new AutomationMsg_WindowDrag(
- handle_, drag_path, flags, press_escape_en_route, &result))) {
- return false;
- }
-
- return result;
-}
-
bool BrowserProxy::WaitForTabCountToBecome(int count) {
bool success = false;
if (!sender_->Send(new AutomationMsg_WaitForTabCountToBecome(
diff --git a/chrome/test/automation/browser_proxy.h b/chrome/test/automation/browser_proxy.h
index 44e0cd3..07d605a 100644
--- a/chrome/test/automation/browser_proxy.h
+++ b/chrome/test/automation/browser_proxy.h
@@ -87,14 +87,6 @@ class BrowserProxy : public AutomationResourceProxy {
// desktop.
bool ApplyAccelerator(int id) WARN_UNUSED_RESULT;
- // Performs a drag operation between the start and end points (both defined
- // in window coordinates). |flags| specifies which buttons are pressed for
- // the drag, as defined in chrome/views/event.h.
- virtual bool SimulateDrag(const gfx::Point& start,
- const gfx::Point& end,
- int flags,
- bool press_escape_en_route) WARN_UNUSED_RESULT;
-
// Block the thread until the tab count is |count|.
// Returns true on success.
bool WaitForTabCountToBecome(int count) WARN_UNUSED_RESULT;
diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc
index ee20842..541f588 100644
--- a/chrome/test/automation/tab_proxy.cc
+++ b/chrome/test/automation/tab_proxy.cc
@@ -428,6 +428,10 @@ void TabProxy::Paste() {
sender_->Send(new AutomationMsg_Paste(handle_));
}
+void TabProxy::SimulateKeyPress(ui::KeyboardCode key) {
+ sender_->Send(new AutomationMsg_KeyPress(handle_, key));
+}
+
void TabProxy::ReloadAsync() {
sender_->Send(new AutomationMsg_ReloadAsync(handle_));
}
diff --git a/chrome/test/automation/tab_proxy.h b/chrome/test/automation/tab_proxy.h
index 9c2e973..c72ee3a 100644
--- a/chrome/test/automation/tab_proxy.h
+++ b/chrome/test/automation/tab_proxy.h
@@ -23,6 +23,7 @@
#include "content/public/common/page_type.h"
#include "content/public/common/security_style.h"
#include "net/base/cert_status_flags.h"
+#include "ui/base/keycodes/keyboard_codes.h"
#include "webkit/glue/window_open_disposition.h"
class BrowserProxy;
@@ -226,6 +227,9 @@ class TabProxy : public AutomationResourceProxy {
void Copy();
void Paste();
+ // Simulates a key press. |key| is the virtual key code of the key pressed.
+ void SimulateKeyPress(ui::KeyboardCode key);
+
// These handlers issue asynchronous Reload, Stop and SaveAs notifications to
// the chrome instance.
void ReloadAsync();
diff --git a/chrome/test/automation/window_proxy.cc b/chrome/test/automation/window_proxy.cc
index aba1329..3d97c58 100644
--- a/chrome/test/automation/window_proxy.cc
+++ b/chrome/test/automation/window_proxy.cc
@@ -16,20 +16,6 @@
#include "googleurl/src/gurl.h"
#include "ui/gfx/rect.h"
-bool WindowProxy::SimulateOSMouseMove(const gfx::Point& location) {
- if (!is_valid()) return false;
-
- return sender_->Send(
- new AutomationMsg_WindowMouseMove(handle_, location));
-}
-
-bool WindowProxy::SimulateOSKeyPress(ui::KeyboardCode key, int flags) {
- if (!is_valid()) return false;
-
- return sender_->Send(
- new AutomationMsg_WindowKeyPress(handle_, key, flags));
-}
-
bool WindowProxy::GetViewBounds(int view_id, gfx::Rect* bounds,
bool screen_coordinates) {
if (!is_valid())
diff --git a/chrome/test/automation/window_proxy.h b/chrome/test/automation/window_proxy.h
index 5461f61..6b574c98 100644
--- a/chrome/test/automation/window_proxy.h
+++ b/chrome/test/automation/window_proxy.h
@@ -14,14 +14,12 @@
#include "base/string16.h"
#include "base/threading/thread.h"
#include "chrome/test/automation/automation_handle_tracker.h"
-#include "ui/base/keycodes/keyboard_codes.h"
class BrowserProxy;
class WindowProxy;
namespace gfx {
- class Point;
- class Rect;
+class Rect;
}
// This class presents the interface to actions that can be performed on a given
@@ -35,16 +33,6 @@ class WindowProxy : public AutomationResourceProxy {
int handle)
: AutomationResourceProxy(tracker, sender, handle) {}
- // Moves the mouse pointer this location at the OS level. |location| is
- // in the window's coordinates.
- bool SimulateOSMouseMove(const gfx::Point& location);
-
- // Simulates a key press at the OS level. |key| is the virtual key code of the
- // key pressed and |flags| specifies which modifiers keys are also pressed (as
- // defined in chrome/views/event.h). Note that this actually sends the event
- // to the window that has focus.
- bool SimulateOSKeyPress(ui::KeyboardCode key, int flags);
-
// Gets the bounds (in window coordinates) that correspond to the view with
// the given ID in this window. Returns true if bounds could be obtained.
// If |screen_coordinates| is true, the bounds are returned in the coordinates