diff options
author | arv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-08 02:37:15 +0000 |
---|---|---|
committer | arv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-08 02:37:15 +0000 |
commit | 8f04ff93eba6678ed17b7157f805212d9438507b (patch) | |
tree | 75623ea56d3ec9d943242ee48c9ef8d0b7d6cf14 /chrome/browser/automation/automation_provider.cc | |
parent | 7b3013e65e46ba705b956ac957f086512dff0677 (diff) | |
download | chromium_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-x | chrome/browser/automation/automation_provider.cc | 13 |
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)) { |