summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation/automation_provider.cc
diff options
context:
space:
mode:
authorarv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-08 02:37:15 +0000
committerarv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-08 02:37:15 +0000
commit8f04ff93eba6678ed17b7157f805212d9438507b (patch)
tree75623ea56d3ec9d943242ee48c9ef8d0b7d6cf14 /chrome/browser/automation/automation_provider.cc
parent7b3013e65e46ba705b956ac957f086512dff0677 (diff)
downloadchromium_src-8f04ff93eba6678ed17b7157f805212d9438507b.zip
chromium_src-8f04ff93eba6678ed17b7157f805212d9438507b.tar.gz
chromium_src-8f04ff93eba6678ed17b7157f805212d9438507b.tar.bz2
Adds a way to set the boundaries of the browser window through
automation and use that to set the size of the window in the "New Tab Cold" to ensure we are testing the normal case and not the small case. BUG=None TEST=The NewTabUIStartupTest, PerfCold should still work. Review URL: http://codereview.chromium.org/149233 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20124 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation/automation_provider.cc')
-rwxr-xr-xchrome/browser/automation/automation_provider.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index d43bab6..1217c1a 100755
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -950,6 +950,7 @@ void AutomationProvider::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_WindowExecuteCommand,
ExecuteBrowserCommand)
IPC_MESSAGE_HANDLER(AutomationMsg_WindowViewBounds, WindowGetViewBounds)
+ IPC_MESSAGE_HANDLER(AutomationMsg_SetWindowBounds, SetWindowBounds)
IPC_MESSAGE_HANDLER(AutomationMsg_SetWindowVisible, SetWindowVisible)
#if defined(OS_WIN)
IPC_MESSAGE_HANDLER(AutomationMsg_WindowClick, WindowSimulateClick)
@@ -1713,6 +1714,18 @@ void AutomationProvider::GetFocusedViewID(int handle, int* view_id) {
}
}
+void AutomationProvider::SetWindowBounds(int handle, const gfx::Rect& bounds,
+ bool* success) {
+ *success = false;
+ if (window_tracker_->ContainsHandle(handle)) {
+ HWND hwnd = window_tracker_->GetResource(handle);
+ if (::MoveWindow(hwnd, bounds.x(), bounds.y(), bounds.width(),
+ bounds.height(), true)) {
+ *success = true;
+ }
+ }
+}
+
void AutomationProvider::SetWindowVisible(int handle, bool visible,
bool* result) {
if (window_tracker_->ContainsHandle(handle)) {