summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-07 21:43:20 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-07 21:43:20 +0000
commit5bcdb31304d676b38ce605180b7d8816e9a8b745 (patch)
tree8e12e0a79c722b6199fb067c2b020c40ec0ddfbf /chrome/test/automation
parentc2374c94270d846055463aa1e61f239957f82f09 (diff)
downloadchromium_src-5bcdb31304d676b38ce605180b7d8816e9a8b745.zip
chromium_src-5bcdb31304d676b38ce605180b7d8816e9a8b745.tar.gz
chromium_src-5bcdb31304d676b38ce605180b7d8816e9a8b745.tar.bz2
Add a UI test to make sure we sanitize the filename
of files saved using the "Save page as..." menu item. This involves adding a new automation provider method for disabling the dialog prompting for a filename. Review URL: http://codereview.chromium.org/16555 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7683 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation')
-rw-r--r--chrome/test/automation/automation_messages_internal.h5
-rw-r--r--chrome/test/automation/automation_proxy.cc4
-rw-r--r--chrome/test/automation/automation_proxy.h5
3 files changed, 14 insertions, 0 deletions
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h
index 47bb11a..6ed478c 100644
--- a/chrome/test/automation/automation_messages_internal.h
+++ b/chrome/test/automation/automation_messages_internal.h
@@ -861,4 +861,9 @@ IPC_BEGIN_MESSAGES(Automation, 0)
IPC_MESSAGE_ROUTED1(AutomationMsg_OverrideEncodingResponse,
bool /* success */)
+ // Used to disable the dialog box that prompts the user for a path when
+ // saving a web page.
+ IPC_MESSAGE_ROUTED1(AutomationMsg_SavePackageShouldPromptUser,
+ bool /* false if we want to not show the dialog */)
+
IPC_END_MESSAGES(Automation)
diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc
index 87ed3680..59303b6 100644
--- a/chrome/test/automation/automation_proxy.cc
+++ b/chrome/test/automation/automation_proxy.cc
@@ -241,6 +241,10 @@ void AutomationProxy::SignalNewTabUITab(int load_time) {
::SetEvent(new_tab_ui_load_complete_);
}
+bool AutomationProxy::SavePackageShouldPromptUser(bool should_prompt) {
+ return Send(new AutomationMsg_SavePackageShouldPromptUser(0, should_prompt));
+}
+
bool AutomationProxy::GetBrowserWindowCount(int* num_windows) {
if (!num_windows) {
NOTREACHED();
diff --git a/chrome/test/automation/automation_proxy.h b/chrome/test/automation/automation_proxy.h
index f068a0d..6632604 100644
--- a/chrome/test/automation/automation_proxy.h
+++ b/chrome/test/automation/automation_proxy.h
@@ -174,6 +174,11 @@ class AutomationProxy : public IPC::Channel::Listener,
// load_time is how long, in ms, the tab contents took to load.
void SignalNewTabUITab(int load_time);
+ // Set whether or not running the save page as... command show prompt the
+ // user for a download path. Returns true if the message is successfully
+ // sent.
+ bool SavePackageShouldPromptUser(bool should_prompt);
+
// Returns the ID of the automation IPC channel, so that it can be
// passed to the app as a launch parameter.
const std::wstring& channel_id() const { return channel_id_; }