summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation/automation_proxy.cc
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-21 23:49:18 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-21 23:49:18 +0000
commit478ff2ed6a244658c0a30d6cbfff1a9046b9ba9d (patch)
treef995985b8749bd31da7cbb73ec73cfce24e97987 /chrome/test/automation/automation_proxy.cc
parent69e38eca8034fe35c22744f59bee77f987ae8755 (diff)
downloadchromium_src-478ff2ed6a244658c0a30d6cbfff1a9046b9ba9d.zip
chromium_src-478ff2ed6a244658c0a30d6cbfff1a9046b9ba9d.tar.gz
chromium_src-478ff2ed6a244658c0a30d6cbfff1a9046b9ba9d.tar.bz2
Reland r14146 which refactors DialogButton into cross platform
code. This is the same as the last change except I renamed class MessageBox to class MessageBoxFlags to avoid conflicting with the same name in windows.h. Review URL: http://codereview.chromium.org/87065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14159 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation/automation_proxy.cc')
-rw-r--r--chrome/test/automation/automation_proxy.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc
index 5715aac..c6b1bb9 100644
--- a/chrome/test/automation/automation_proxy.cc
+++ b/chrome/test/automation/automation_proxy.cc
@@ -318,11 +318,9 @@ 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) {
+ MessageBoxFlags::DialogButton* button) {
if (!showing_app_modal_dialog || !button) {
NOTREACHED();
return false;
@@ -338,12 +336,12 @@ bool AutomationProxy::GetShowingAppModalDialog(
return false;
}
- *button = static_cast<views::DialogDelegate::DialogButton>(button_int);
+ *button = static_cast<MessageBoxFlags::DialogButton>(button_int);
return true;
}
bool AutomationProxy::ClickAppModalDialogButton(
- views::DialogDelegate::DialogButton button) {
+ MessageBoxFlags::DialogButton button) {
bool succeeded = false;
if (!SendWithTimeout(
@@ -361,8 +359,7 @@ bool AutomationProxy::WaitForAppModalDialog(int wait_timeout) {
const TimeDelta timeout = TimeDelta::FromMilliseconds(wait_timeout);
while (TimeTicks::Now() - start < timeout) {
bool dialog_shown = false;
- views::DialogDelegate::DialogButton button =
- views::DialogDelegate::DIALOGBUTTON_NONE;
+ MessageBoxFlags::DialogButton button = MessageBoxFlags::DIALOGBUTTON_NONE;
bool succeeded = GetShowingAppModalDialog(&dialog_shown, &button);
if (!succeeded) {
// Try again next round, but log it.
@@ -370,12 +367,11 @@ bool AutomationProxy::WaitForAppModalDialog(int wait_timeout) {
} else if (dialog_shown) {
return true;
}
- Sleep(automation::kSleepTime);
+ PlatformThread::Sleep(automation::kSleepTime);
}
// Dialog never shown.
return false;
}
-#endif // defined(OS_WIN)
bool AutomationProxy::WaitForURLDisplayed(GURL url, int wait_timeout) {
const TimeTicks start = TimeTicks::Now();