summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-25 10:57:47 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-25 10:57:47 +0000
commit6d4480b50022d0eaee080b86be3a304a46b0454d (patch)
treeb806197b02428264100c33d71d1fc9cba496e482 /chrome/test/automation
parent55e57d4d2326bd98d6e14c92ba055754ef77b0e6 (diff)
downloadchromium_src-6d4480b50022d0eaee080b86be3a304a46b0454d.zip
chromium_src-6d4480b50022d0eaee080b86be3a304a46b0454d.tar.gz
chromium_src-6d4480b50022d0eaee080b86be3a304a46b0454d.tar.bz2
Make basic bits of chrome/test/automation build on Linux.
Review URL: http://codereview.chromium.org/27060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10331 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation')
-rw-r--r--chrome/test/automation/automation.scons15
-rw-r--r--chrome/test/automation/automation_proxy.cc105
-rw-r--r--chrome/test/automation/automation_proxy.h28
-rw-r--r--chrome/test/automation/browser_proxy.cc12
-rw-r--r--chrome/test/automation/browser_proxy.h14
-rw-r--r--chrome/test/automation/tab_proxy.cc2
-rw-r--r--chrome/test/automation/tab_proxy.h13
-rw-r--r--chrome/test/automation/window_proxy.cc4
-rw-r--r--chrome/test/automation/window_proxy.h10
9 files changed, 118 insertions, 85 deletions
diff --git a/chrome/test/automation/automation.scons b/chrome/test/automation/automation.scons
index 76e731c..3f89fdd 100644
--- a/chrome/test/automation/automation.scons
+++ b/chrome/test/automation/automation.scons
@@ -8,6 +8,7 @@ env = env.Clone()
env.ApplySConscript([
'$CHROME_DIR/third_party/wtl/using_wtl.scons',
+ '$CHROME_SRC_DIR/tools/grit/build/using_generated_resources.scons',
'$SKIA_DIR/using_skia.scons',
])
@@ -37,9 +38,17 @@ input_files = ChromeFileList([
'window_proxy.h',
])
-# TODO(port):
-if env.Bit('windows'):
- env.ChromeLibrary('automation', input_files)
+if not env.Bit('windows'):
+ # TODO(port): port.
+ input_files.Remove(
+ 'autocomplete_edit_proxy.cc',
+ 'browser_proxy.cc',
+ 'constrained_window_proxy.cc',
+ 'tab_proxy.cc',
+ 'window_proxy.cc',
+ )
+
+env.ChromeLibrary('automation', input_files)
p = env.ChromeMSVSProject('automation.vcproj',
dest=('$CHROME_SRC_DIR/chrome/'
diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc
index 634d1e0..06ec99e 100644
--- a/chrome/test/automation/automation_proxy.cc
+++ b/chrome/test/automation/automation_proxy.cc
@@ -6,16 +6,22 @@
#include "chrome/test/automation/automation_proxy.h"
+#include "base/basictypes.h"
#include "base/logging.h"
#include "base/platform_thread.h"
#include "base/process_util.h"
#include "base/ref_counted.h"
+#include "base/waitable_event.h"
#include "chrome/test/automation/automation_constants.h"
#include "chrome/test/automation/automation_messages.h"
#include "chrome/test/automation/browser_proxy.h"
#include "chrome/test/automation/tab_proxy.h"
#include "chrome/test/automation/window_proxy.h"
+
+#if defined(OS_WIN)
+// TODO(port): Enable when dialog_delegate is ported.
#include "chrome/views/dialog_delegate.h"
+#endif
using base::TimeDelta;
using base::TimeTicks;
@@ -25,36 +31,17 @@ using base::TimeTicks;
class AutomationRequest :
public base::RefCountedThreadSafe<AutomationRequest> {
public:
- AutomationRequest() {
+ AutomationRequest() : received_response_(true, false) {
static int32 routing_id = 0;
routing_id_ = ++routing_id;
- received_response_ = ::CreateEvent(NULL, TRUE, FALSE, NULL);
- DCHECK(received_response_);
- }
- ~AutomationRequest() {
- DCHECK(received_response_);
- ::CloseHandle(received_response_);
- }
-
- // This is called on the foreground thread to block while waiting for a
- // response from the app.
- // The function returns true if response is received, and returns false
- // if there is a failure or timeout.
- bool WaitForResponse(uint32 timeout_ms, bool* is_timeout) {
- uint32 result = ::WaitForSingleObject(received_response_, timeout_ms);
- if (is_timeout)
- *is_timeout = (result == WAIT_TIMEOUT);
-
- return result != WAIT_FAILED && result != WAIT_TIMEOUT;
}
// This is called on the background thread once the response has been
// received and the foreground thread can resume execution.
- bool SignalResponseReady(const IPC::Message& response) {
+ void SignalResponseReady(const IPC::Message& response) {
response_.reset(new IPC::Message(response));
- DCHECK(received_response_);
- return !!::SetEvent(received_response_);
+ received_response_.Signal();
}
// This can be used to take ownership of the response object that
@@ -77,7 +64,7 @@ private:
int32 routing_id_;
scoped_ptr<IPC::Message> response_;
- HANDLE received_response_;
+ base::WaitableEvent received_response_;
};
namespace {
@@ -142,9 +129,13 @@ class AutomationMessageFilter : public IPC::ChannelProxy::MessageFilter {
AutomationProxy::AutomationProxy(int command_execution_timeout_ms)
- : current_request_(NULL),
- command_execution_timeout_ms_(command_execution_timeout_ms) {
- InitializeEvents();
+ : app_launched_(true, false),
+ initial_loads_complete_(true, false),
+ new_tab_ui_load_complete_(true, false),
+ shutdown_event_(new base::WaitableEvent(true, false)),
+ current_request_(NULL),
+ command_execution_timeout_(
+ TimeDelta::FromMilliseconds(command_execution_timeout_ms)) {
InitializeChannelID();
InitializeHandleTracker();
InitializeThread();
@@ -153,7 +144,7 @@ AutomationProxy::AutomationProxy(int command_execution_timeout_ms)
AutomationProxy::~AutomationProxy() {
DCHECK(shutdown_event_.get() != NULL);
- ::SetEvent(shutdown_event_->handle());
+ shutdown_event_->Signal();
// Destruction order is important. Thread has to outlive the channel and
// tracker has to outlive the thread since we access the tracker inside
// AutomationMessageFilter::OnMessageReceived.
@@ -161,28 +152,6 @@ AutomationProxy::~AutomationProxy() {
thread_.reset();
DCHECK(NULL == current_request_);
tracker_.reset();
- ::CloseHandle(app_launched_);
- ::CloseHandle(initial_loads_complete_);
- ::CloseHandle(new_tab_ui_load_complete_);
-}
-
-void AutomationProxy::InitializeEvents() {
- app_launched_ =
- CreateEvent(NULL, // Handle cannot be inherited by child processes.
- TRUE, // No automatic reset after a waiting thread released.
- FALSE, // Initially not signalled.
- NULL); // No name.
- DCHECK(app_launched_);
-
- // See the above call to CreateEvent to understand these parameters.
- initial_loads_complete_ = CreateEvent(NULL, TRUE, FALSE, NULL);
- DCHECK(initial_loads_complete_);
-
- // See the above call to CreateEvent to understand these parameters.
- new_tab_ui_load_complete_ = CreateEvent(NULL, TRUE, FALSE, NULL);
- DCHECK(new_tab_ui_load_complete_);
-
- shutdown_event_.reset(new base::WaitableEvent(true, false));
}
void AutomationProxy::InitializeChannelID() {
@@ -231,36 +200,33 @@ void AutomationProxy::InitializeHandleTracker() {
}
bool AutomationProxy::WaitForAppLaunch() {
- return ::WaitForSingleObject(app_launched_,
- command_execution_timeout_ms_) == WAIT_OBJECT_0;
+ return app_launched_.TimedWait(command_execution_timeout_);
}
void AutomationProxy::SignalAppLaunch() {
- ::SetEvent(app_launched_);
+ app_launched_.Signal();
}
bool AutomationProxy::WaitForInitialLoads() {
- return ::WaitForSingleObject(initial_loads_complete_,
- command_execution_timeout_ms_) == WAIT_OBJECT_0;
+ return initial_loads_complete_.TimedWait(command_execution_timeout_);
}
bool AutomationProxy::WaitForInitialNewTabUILoad(int* load_time) {
- if (::WaitForSingleObject(new_tab_ui_load_complete_,
- command_execution_timeout_ms_) == WAIT_OBJECT_0) {
+ if (new_tab_ui_load_complete_.TimedWait(command_execution_timeout_)) {
*load_time = new_tab_ui_load_time_;
- ::ResetEvent(new_tab_ui_load_complete_);
+ new_tab_ui_load_complete_.Reset();
return true;
}
return false;
}
void AutomationProxy::SignalInitialLoads() {
- ::SetEvent(initial_loads_complete_);
+ initial_loads_complete_.Signal();
}
void AutomationProxy::SignalNewTabUITab(int load_time) {
new_tab_ui_load_time_ = load_time;
- ::SetEvent(new_tab_ui_load_complete_);
+ new_tab_ui_load_complete_.Signal();
}
bool AutomationProxy::SavePackageShouldPromptUser(bool should_prompt) {
@@ -275,7 +241,7 @@ bool AutomationProxy::GetBrowserWindowCount(int* num_windows) {
bool succeeded = SendWithTimeout(
new AutomationMsg_BrowserWindowCount(0, num_windows),
- command_execution_timeout_ms_, NULL);
+ command_execution_timeout_ms(), NULL);
if (!succeeded) {
DLOG(ERROR) << "GetWindowCount did not complete in a timely fashion";
@@ -318,6 +284,8 @@ bool AutomationProxy::WaitForWindowCountToBecome(int count,
return false;
}
+#if defined(OS_WIN)
+// TODO(port): Port when DialogDelegate is ported.
bool AutomationProxy::GetShowingAppModalDialog(
bool* showing_app_modal_dialog,
views::DialogDelegate::DialogButton* button) {
@@ -331,7 +299,7 @@ bool AutomationProxy::GetShowingAppModalDialog(
if (!SendWithTimeout(
new AutomationMsg_ShowingAppModalDialog(
0, showing_app_modal_dialog, &button_int),
- command_execution_timeout_ms_, NULL)) {
+ command_execution_timeout_ms(), NULL)) {
DLOG(ERROR) << "ShowingAppModalDialog did not complete in a timely fashion";
return false;
}
@@ -346,7 +314,8 @@ bool AutomationProxy::ClickAppModalDialogButton(
if (!SendWithTimeout(
new AutomationMsg_ClickAppModalDialogButton(
- 0, button, &succeeded), command_execution_timeout_ms_, NULL)) {
+ 0, button, &succeeded),
+ command_execution_timeout_ms(), NULL)) {
return false;
}
@@ -372,6 +341,7 @@ bool AutomationProxy::WaitForAppModalDialog(int wait_timeout) {
// Dialog never shown.
return false;
}
+#endif // defined(OS_WIN)
bool AutomationProxy::SetFilteredInet(bool enabled) {
return Send(new AutomationMsg_SetFilteredInet(0, enabled));
@@ -395,7 +365,7 @@ WindowProxy* AutomationProxy::GetActiveWindow() {
int handle = 0;
if (!SendWithTimeout(new AutomationMsg_ActiveWindow(0, &handle),
- command_execution_timeout_ms_, NULL)) {
+ command_execution_timeout_ms(), NULL)) {
return NULL;
}
@@ -408,7 +378,7 @@ BrowserProxy* AutomationProxy::GetBrowserWindow(int window_index) {
if (!SendWithTimeout(new AutomationMsg_BrowserWindow(0, window_index,
&handle),
- command_execution_timeout_ms_, NULL)) {
+ command_execution_timeout_ms(), NULL)) {
DLOG(ERROR) << "GetBrowserWindow did not complete in a timely fashion";
return NULL;
}
@@ -424,7 +394,7 @@ BrowserProxy* AutomationProxy::GetLastActiveBrowserWindow() {
int handle = 0;
if (!SendWithTimeout(new AutomationMsg_LastActiveBrowserWindow(
- 0, &handle), command_execution_timeout_ms_, NULL)) {
+ 0, &handle), command_execution_timeout_ms(), NULL)) {
DLOG(ERROR) << "GetLastActiveBrowserWindow did not complete in a timely fashion";
return NULL;
}
@@ -433,7 +403,7 @@ BrowserProxy* AutomationProxy::GetLastActiveBrowserWindow() {
}
bool AutomationProxy::Send(IPC::Message* message) {
- return SendWithTimeout(message, INFINITE, NULL);
+ return SendWithTimeout(message, base::kNoTimeout, NULL);
}
bool AutomationProxy::SendWithTimeout(IPC::Message* message, int timeout,
@@ -466,6 +436,8 @@ bool AutomationProxy::OpenNewBrowserWindow(int show_command) {
return Send(new AutomationMsg_OpenNewBrowserWindow(0, show_command));
}
+#if defined(OS_WIN)
+// TODO(port): Replace HWNDs.
TabProxy* AutomationProxy::CreateExternalTab(HWND parent,
const gfx::Rect& dimensions,
unsigned int style,
@@ -485,3 +457,4 @@ TabProxy* AutomationProxy::CreateExternalTab(HWND parent,
return new TabProxy(this, tracker_.get(), handle);
}
+#endif // defined(OS_WIN)
diff --git a/chrome/test/automation/automation_proxy.h b/chrome/test/automation/automation_proxy.h
index 2988b6f..118983b 100644
--- a/chrome/test/automation/automation_proxy.h
+++ b/chrome/test/automation/automation_proxy.h
@@ -9,13 +9,19 @@
#include "base/basictypes.h"
#include "base/scoped_ptr.h"
+#include "base/time.h"
#include "base/thread.h"
+#include "base/waitable_event.h"
#include "chrome/common/ipc_channel_proxy.h"
#include "chrome/common/ipc_message.h"
#include "chrome/common/ipc_sync_channel.h"
#include "chrome/test/automation/automation_handle_tracker.h"
#include "chrome/test/automation/automation_messages.h"
+
+#if defined(OS_WIN)
+// TODO(port): Enable this or equivalent.
#include "chrome/views/dialog_delegate.h"
+#endif
class AutomationRequest;
class BrowserProxy;
@@ -28,6 +34,9 @@ class AutomationMessageSender : public IPC::Message::Sender {
public:
// Sends a message synchronously; it doesn't return until a response has been
// received or a timeout has expired.
+ //
+ // Use base::kNoTimeout for no timeout.
+ //
// The function returns true if a response is received, and returns false if
// there is a failure or timeout (in milliseconds). If return after timeout,
// is_timeout is set to true.
@@ -93,6 +102,9 @@ class AutomationProxy : public IPC::Channel::Listener,
// Returns true on success.
bool WaitForWindowCountToBecome(int target_count, int wait_timeout);
+#if defined(OS_WIN)
+ // TODO(port): Enable when we have portable DialogDelegate.
+
// Returns whether an app modal dialog window is showing right now (i.e., a
// javascript alert), and what buttons it contains.
bool GetShowingAppModalDialog(bool* showing_app_modal_dialog,
@@ -100,6 +112,7 @@ class AutomationProxy : public IPC::Channel::Listener,
// Simulates a click on a dialog button.
bool ClickAppModalDialogButton(views::DialogDelegate::DialogButton button);
+#endif // defined(OS_WIN)
// Block the thread until a modal dialog is displayed. Returns true on
// success.
@@ -161,18 +174,21 @@ class AutomationProxy : public IPC::Channel::Listener,
// the tracker.
void InvalidateHandle(const IPC::Message& message);
+#if defined(OS_WIN)
+ // TODO(port): Enable when we can replace HWND.
+
// Creates a tab that can hosted in an external process. The function
// returns a TabProxy representing the tab as well as a window handle
// that can be reparented in another process.
TabProxy* CreateExternalTab(HWND parent, const gfx::Rect& dimensions,
unsigned int style, HWND* external_tab_container);
+#endif // defined(OS_WIN)
int command_execution_timeout_ms() const {
- return command_execution_timeout_ms_;
+ return static_cast<int>(command_execution_timeout_.InMilliseconds());
}
private:
- void InitializeEvents();
void InitializeChannelID();
void InitializeThread();
void InitializeChannel();
@@ -183,9 +199,9 @@ class AutomationProxy : public IPC::Channel::Listener,
scoped_ptr<IPC::SyncChannel> channel_;
scoped_ptr<AutomationHandleTracker> tracker_;
- HANDLE app_launched_;
- HANDLE initial_loads_complete_;
- HANDLE new_tab_ui_load_complete_;
+ base::WaitableEvent app_launched_;
+ base::WaitableEvent initial_loads_complete_;
+ base::WaitableEvent new_tab_ui_load_complete_;
int new_tab_ui_load_time_;
// An event that notifies when we are shutting-down.
@@ -194,7 +210,7 @@ class AutomationProxy : public IPC::Channel::Listener,
AutomationRequest* current_request_;
// Delay to let the browser execute the command.
- int command_execution_timeout_ms_;
+ base::TimeDelta command_execution_timeout_;
DISALLOW_COPY_AND_ASSIGN(AutomationProxy);
};
diff --git a/chrome/test/automation/browser_proxy.cc b/chrome/test/automation/browser_proxy.cc
index c13fd29..3a0305d 100644
--- a/chrome/test/automation/browser_proxy.cc
+++ b/chrome/test/automation/browser_proxy.cc
@@ -19,7 +19,7 @@ using base::TimeDelta;
using base::TimeTicks;
bool BrowserProxy::ActivateTab(int tab_index) {
- return ActivateTabWithTimeout(tab_index, INFINITE, NULL);
+ return ActivateTabWithTimeout(tab_index, base::kNoTimeout, NULL);
}
bool BrowserProxy::ActivateTabWithTimeout(int tab_index, uint32 timeout_ms,
@@ -39,7 +39,7 @@ bool BrowserProxy::ActivateTabWithTimeout(int tab_index, uint32 timeout_ms,
}
bool BrowserProxy::BringToFront() {
- return BringToFrontWithTimeout(INFINITE, NULL);
+ return BringToFrontWithTimeout(base::kNoTimeout, NULL);
}
bool BrowserProxy::BringToFrontWithTimeout(uint32 timeout_ms,
@@ -81,7 +81,7 @@ bool BrowserProxy::AppendTab(const GURL& tab_url) {
}
bool BrowserProxy::GetActiveTabIndex(int* active_tab_index) const {
- return GetActiveTabIndexWithTimeout(active_tab_index, INFINITE, NULL);
+ return GetActiveTabIndexWithTimeout(active_tab_index, base::kNoTimeout, NULL);
}
bool BrowserProxy::GetActiveTabIndexWithTimeout(int* active_tab_index,
@@ -124,7 +124,7 @@ TabProxy* BrowserProxy::GetTab(int tab_index) const {
}
TabProxy* BrowserProxy::GetActiveTab() const {
- return GetActiveTabWithTimeout(INFINITE, NULL);
+ return GetActiveTabWithTimeout(base::kNoTimeout, NULL);
}
TabProxy* BrowserProxy::GetActiveTabWithTimeout(uint32 timeout_ms,
@@ -136,7 +136,7 @@ TabProxy* BrowserProxy::GetActiveTabWithTimeout(uint32 timeout_ms,
}
bool BrowserProxy::GetTabCount(int* num_tabs) const {
- return GetTabCountWithTimeout(num_tabs, INFINITE, NULL);
+ return GetTabCountWithTimeout(num_tabs, base::kNoTimeout, NULL);
}
bool BrowserProxy::GetTabCountWithTimeout(int* num_tabs, uint32 timeout_ms,
@@ -175,7 +175,7 @@ bool BrowserProxy::SimulateDrag(const POINT& start,
const POINT& end,
int flags,
bool press_escape_en_route) {
- return SimulateDragWithTimeout(start, end, flags, INFINITE, NULL,
+ return SimulateDragWithTimeout(start, end, flags, base::kNoTimeout, NULL,
press_escape_en_route);
}
diff --git a/chrome/test/automation/browser_proxy.h b/chrome/test/automation/browser_proxy.h
index 9a61993..cc27d61 100644
--- a/chrome/test/automation/browser_proxy.h
+++ b/chrome/test/automation/browser_proxy.h
@@ -5,8 +5,14 @@
#ifndef CHROME_TEST_AUTOMATION_BROWSER_PROXY_H_
#define CHROME_TEST_AUTOMATION_BROWSER_PROXY_H_
+#include "build/build_config.h"
+
+#if defined(OS_WIN)
#include <windows.h>
+#endif
+
#include <string>
+
#include "chrome/test/automation/automation_handle_tracker.h"
class GURL;
@@ -116,6 +122,9 @@ class BrowserProxy : public AutomationResourceProxy {
// desktop.
bool ApplyAccelerator(int id);
+#if defined(OS_WIN)
+ // TODO(port): Use portable replacement for POINT.
+
// 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.
@@ -128,6 +137,7 @@ class BrowserProxy : public AutomationResourceProxy {
int flags, uint32 timeout_ms,
bool* is_timeout,
bool press_escape_en_route);
+#endif // defined(OS_WIN)
// Block the thread until the tab count changes.
// |count| is the original tab count.
@@ -156,12 +166,16 @@ class BrowserProxy : public AutomationResourceProxy {
// will be false. Returns false on failure.
bool IsFindWindowFullyVisible(bool* is_visible);
+#if defined(OS_WIN)
+ // TODO(port): Use portable equivalent of HWND.
+
// Gets the outermost HWND that corresponds to the given browser.
// Returns true if the call was successful.
// Note that ideally this should go and the version of WindowProxy should be
// used instead. We have to keep it for start_up_tests that test against a
// reference build.
bool GetHWND(HWND* handle) const;
+#endif // defined(OS_WIN)
// Run the specified command in the browser (see browser_commands.cc for the
// list of supported commands). Returns true if the command was successfully
diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc
index e36d683..a70351f 100644
--- a/chrome/test/automation/tab_proxy.cc
+++ b/chrome/test/automation/tab_proxy.cc
@@ -72,7 +72,7 @@ int TabProxy::FindInPage(const std::wstring& search_string,
}
AutomationMsg_NavigationResponseValues TabProxy::NavigateToURL(const GURL& url) {
- return NavigateToURLWithTimeout(url, INFINITE, NULL);
+ return NavigateToURLWithTimeout(url, base::kNoTimeout, NULL);
}
AutomationMsg_NavigationResponseValues TabProxy::NavigateToURLWithTimeout(
diff --git a/chrome/test/automation/tab_proxy.h b/chrome/test/automation/tab_proxy.h
index 1e393f54..1984224 100644
--- a/chrome/test/automation/tab_proxy.h
+++ b/chrome/test/automation/tab_proxy.h
@@ -5,7 +5,12 @@
#ifndef CHROME_TEST_AUTOMATION_TAB_PROXY_H_
#define CHROME_TEST_AUTOMATION_TAB_PROXY_H_
+#include "build/build_config.h"
+
+#if defined(OS_WIN)
#include <wtypes.h>
+#endif
+
#include <string>
#include <vector>
@@ -127,9 +132,13 @@ class TabProxy : public AutomationResourceProxy {
// the last tab.
bool Close(bool wait_until_closed);
+#if defined(OS_WIN)
+ // TODO(port): Use portable replacement for HWND.
+
// Gets the HWND that corresponds to the content area of this tab.
// Returns true if the call was successful.
bool GetHWND(HWND* hwnd) const;
+#endif // defined(OS_WIN)
// Gets the process ID that corresponds to the content area of this tab.
// Returns true if the call was successful. If the specified tab has no
@@ -197,6 +206,9 @@ class TabProxy : public AutomationResourceProxy {
// page has been hidden. Return false if a failure happens.
bool HideInterstitialPage();
+#if defined(OS_WIN)
+ // TODO(port): Use something portable.
+
// This sets the keyboard accelerators to be used by an externally
// hosted tab. This call is not valid on a regular tab hosted within
// Chrome.
@@ -206,6 +218,7 @@ class TabProxy : public AutomationResourceProxy {
// accelerator keys that it did not process. This gives the tab a chance
// to handle the keys
bool ProcessUnhandledAccelerator(const MSG& msg);
+#endif // defined(OS_WIN)
// Ask the tab to set focus to either the first or last element on the page.
bool SetInitialFocus(bool reverse);
diff --git a/chrome/test/automation/window_proxy.cc b/chrome/test/automation/window_proxy.cc
index d43f718..030fea2 100644
--- a/chrome/test/automation/window_proxy.cc
+++ b/chrome/test/automation/window_proxy.cc
@@ -69,7 +69,7 @@ bool WindowProxy::Activate() {
bool WindowProxy::GetViewBounds(int view_id, gfx::Rect* bounds,
bool screen_coordinates) {
return GetViewBoundsWithTimeout(view_id, bounds, screen_coordinates,
- INFINITE, NULL);
+ base::kNoTimeout, NULL);
}
bool WindowProxy::GetViewBoundsWithTimeout(int view_id, gfx::Rect* bounds,
@@ -106,7 +106,7 @@ bool WindowProxy::GetFocusedViewID(int* view_id) {
}
BrowserProxy* WindowProxy::GetBrowser() {
- return GetBrowserWithTimeout(INFINITE, NULL);
+ return GetBrowserWithTimeout(base::kNoTimeout, NULL);
}
BrowserProxy* WindowProxy::GetBrowserWithTimeout(uint32 timeout_ms,
diff --git a/chrome/test/automation/window_proxy.h b/chrome/test/automation/window_proxy.h
index 76c863e..8bade17 100644
--- a/chrome/test/automation/window_proxy.h
+++ b/chrome/test/automation/window_proxy.h
@@ -5,9 +5,13 @@
#ifndef CHROME_TEST_AUTOMATION_WINDOW_PROXY_H__
#define CHROME_TEST_AUTOMATION_WINDOW_PROXY_H__
-#include <string>
+#include "build/build_config.h"
+#if defined(OS_WIN)
#include <windows.h>
+#endif
+
+#include <string>
#include "base/thread.h"
#include "chrome/test/automation/automation_handle_tracker.h"
@@ -31,6 +35,9 @@ class WindowProxy : public AutomationResourceProxy {
: AutomationResourceProxy(tracker, sender, handle) {}
virtual ~WindowProxy() {}
+#if defined(OS_WIN)
+ // TODO(port): Use portable replacements for windowsisms.
+
// Gets the outermost HWND that corresponds to the given window.
// Returns true if the call was successful.
bool GetHWND(HWND* handle) const;
@@ -41,6 +48,7 @@ class WindowProxy : public AutomationResourceProxy {
// 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)
// Simulates a key press at the OS level. |key| is the key pressed and
// |flags| specifies which modifiers keys are also pressed (as defined in