summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-04 19:22:27 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-04 19:22:27 +0000
commitef062ba24b2916071e286d1abdfbfe3de4d1f52a (patch)
tree675703f6b36f24f58c74781724d9bffb518c8430 /chrome/test/automation
parent5b2532dde2c9114ceb9f15d756246a1710ccff4e (diff)
downloadchromium_src-ef062ba24b2916071e286d1abdfbfe3de4d1f52a.zip
chromium_src-ef062ba24b2916071e286d1abdfbfe3de4d1f52a.tar.gz
chromium_src-ef062ba24b2916071e286d1abdfbfe3de4d1f52a.tar.bz2
views: Move DialogButton enum into ui/base/ and put it into the ui namespace.
R=sky@chromium.org Review URL: http://codereview.chromium.org/8334041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108692 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation')
-rw-r--r--chrome/test/automation/automation_proxy.cc12
-rw-r--r--chrome/test/automation/automation_proxy.h13
-rw-r--r--chrome/test/automation/automation_proxy_uitest.cc24
3 files changed, 21 insertions, 28 deletions
diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc
index e852629..24b35fe 100644
--- a/chrome/test/automation/automation_proxy.cc
+++ b/chrome/test/automation/automation_proxy.cc
@@ -12,9 +12,9 @@
#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
-#include "base/threading/platform_thread.h"
#include "base/process_util.h"
#include "base/synchronization/waitable_event.h"
+#include "base/threading/platform_thread.h"
#include "chrome/common/automation_constants.h"
#include "chrome/common/automation_messages.h"
#include "chrome/common/chrome_version_info.h"
@@ -290,9 +290,8 @@ bool AutomationProxy::WaitForWindowCountToBecome(int count) {
return wait_success;
}
-bool AutomationProxy::GetShowingAppModalDialog(
- bool* showing_app_modal_dialog,
- ui::MessageBoxFlags::DialogButton* button) {
+bool AutomationProxy::GetShowingAppModalDialog(bool* showing_app_modal_dialog,
+ ui::DialogButton* button) {
if (!showing_app_modal_dialog || !button) {
NOTREACHED();
return false;
@@ -305,12 +304,11 @@ bool AutomationProxy::GetShowingAppModalDialog(
return false;
}
- *button = static_cast<ui::MessageBoxFlags::DialogButton>(button_int);
+ *button = static_cast<ui::DialogButton>(button_int);
return true;
}
-bool AutomationProxy::ClickAppModalDialogButton(
- ui::MessageBoxFlags::DialogButton button) {
+bool AutomationProxy::ClickAppModalDialogButton(ui::DialogButton button) {
bool succeeded = false;
if (!Send(new AutomationMsg_ClickAppModalDialogButton(
diff --git a/chrome/test/automation/automation_proxy.h b/chrome/test/automation/automation_proxy.h
index 37f08ec..834023e 100644
--- a/chrome/test/automation/automation_proxy.h
+++ b/chrome/test/automation/automation_proxy.h
@@ -12,11 +12,11 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
-#include "base/threading/platform_thread.h"
#include "base/process_util.h"
-#include "base/time.h"
-#include "base/threading/thread.h"
#include "base/synchronization/waitable_event.h"
+#include "base/threading/platform_thread.h"
+#include "base/threading/thread.h"
+#include "base/time.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/automation_constants.h"
#include "chrome/test/automation/automation_handle_tracker.h"
@@ -25,7 +25,7 @@
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_message.h"
#include "ipc/ipc_sync_channel.h"
-#include "ui/base/message_box_flags.h"
+#include "ui/base/ui_base_types.h"
#include "ui/gfx/native_widget_types.h"
class BrowserProxy;
@@ -127,11 +127,10 @@ class AutomationProxy : public IPC::Channel::Listener,
// 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,
- ui::MessageBoxFlags::DialogButton* button) WARN_UNUSED_RESULT;
+ ui::DialogButton* button) WARN_UNUSED_RESULT;
// Simulates a click on a dialog button. Synchronous.
- bool ClickAppModalDialogButton(
- ui::MessageBoxFlags::DialogButton button) WARN_UNUSED_RESULT;
+ bool ClickAppModalDialogButton(ui::DialogButton button) WARN_UNUSED_RESULT;
// Block the thread until a modal dialog is displayed. Returns true on
// success.
diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc
index 9b2d4df..8a1158d6 100644
--- a/chrome/test/automation/automation_proxy_uitest.cc
+++ b/chrome/test/automation/automation_proxy_uitest.cc
@@ -39,8 +39,8 @@
#define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
#include "testing/gmock_mutant.h"
#include "third_party/skia/include/core/SkBitmap.h"
-#include "ui/base/message_box_flags.h"
#include "ui/base/ui_base_switches.h"
+#include "ui/base/ui_base_types.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/rect.h"
@@ -1401,12 +1401,11 @@ TEST_F(AutomationProxyTest, FLAKY_AppModalDialogTest) {
ASSERT_TRUE(tab.get());
bool modal_dialog_showing = false;
- ui::MessageBoxFlags::DialogButton button =
- ui::MessageBoxFlags::DIALOGBUTTON_NONE;
+ ui::DialogButton button = ui::DIALOG_BUTTON_NONE;
EXPECT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing,
&button));
EXPECT_FALSE(modal_dialog_showing);
- EXPECT_EQ(ui::MessageBoxFlags::DIALOGBUTTON_NONE, button);
+ EXPECT_EQ(ui::DIALOG_BUTTON_NONE, button);
// Show a simple alert.
std::string content =
@@ -1419,19 +1418,19 @@ TEST_F(AutomationProxyTest, FLAKY_AppModalDialogTest) {
EXPECT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing,
&button));
EXPECT_TRUE(modal_dialog_showing);
- EXPECT_EQ(ui::MessageBoxFlags::DIALOGBUTTON_OK, button);
+ EXPECT_EQ(ui::DIALOG_BUTTON_OK, button);
// Test that clicking missing button fails graciously and does not close the
// dialog.
EXPECT_FALSE(automation()->ClickAppModalDialogButton(
- ui::MessageBoxFlags::DIALOGBUTTON_CANCEL));
+ ui::DIALOG_BUTTON_CANCEL));
EXPECT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing,
&button));
EXPECT_TRUE(modal_dialog_showing);
// Now click OK, that should close the dialog.
EXPECT_TRUE(automation()->ClickAppModalDialogButton(
- ui::MessageBoxFlags::DIALOGBUTTON_OK));
+ ui::DIALOG_BUTTON_OK));
EXPECT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing,
&button));
EXPECT_FALSE(modal_dialog_showing);
@@ -1447,12 +1446,10 @@ TEST_F(AutomationProxyTest, FLAKY_AppModalDialogTest) {
EXPECT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing,
&button));
EXPECT_TRUE(modal_dialog_showing);
- EXPECT_EQ(ui::MessageBoxFlags::DIALOGBUTTON_OK |
- ui::MessageBoxFlags::DIALOGBUTTON_CANCEL, button);
+ EXPECT_EQ(ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL, button);
// Click OK.
- EXPECT_TRUE(automation()->ClickAppModalDialogButton(
- ui::MessageBoxFlags::DIALOGBUTTON_OK));
+ EXPECT_TRUE(automation()->ClickAppModalDialogButton(ui::DIALOG_BUTTON_OK));
EXPECT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing,
&button));
EXPECT_FALSE(modal_dialog_showing);
@@ -1469,12 +1466,11 @@ TEST_F(AutomationProxyTest, FLAKY_AppModalDialogTest) {
EXPECT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing,
&button));
EXPECT_TRUE(modal_dialog_showing);
- EXPECT_EQ(ui::MessageBoxFlags::DIALOGBUTTON_OK |
- ui::MessageBoxFlags::DIALOGBUTTON_CANCEL, button);
+ EXPECT_EQ(ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL, button);
// Click Cancel this time.
EXPECT_TRUE(automation()->ClickAppModalDialogButton(
- ui::MessageBoxFlags::DIALOGBUTTON_CANCEL));
+ ui::DIALOG_BUTTON_CANCEL));
EXPECT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing,
&button));
EXPECT_FALSE(modal_dialog_showing);