summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation/automation_provider.h
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-04 00:27:01 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-04 00:27:01 +0000
commit7dad3d5f3d40d86158ed96536fd681701b43611d (patch)
treeec2dd5d5a9a836eb1244d6b9e1d36a6518a15f17 /chrome/browser/automation/automation_provider.h
parentf661899570cea4abb593ea7d6d8143afe0c7f8b8 (diff)
downloadchromium_src-7dad3d5f3d40d86158ed96536fd681701b43611d.zip
chromium_src-7dad3d5f3d40d86158ed96536fd681701b43611d.tar.gz
chromium_src-7dad3d5f3d40d86158ed96536fd681701b43611d.tar.bz2
Test cookie prompting.
Adds automation plumbing to support changing the content settings. This change also fixes WaitForNavigation to watch for the LOAD_STOP event instead of the NAV_ENTRY_COMMITTED event. This better matches the intent (I think) of the automation interface, and it also matches the similar function defined in ui_test_utils (used by browser tests). This also better matches the NavigationNotificationObserver, which seems desirable given the implementation of AutomationProvider::WaitForNavigation. It turns out that only one UI test was using WaitForNavigation, and I confirmed that it still functions properly. This change also modifies the NavigationNotificationObserver to allow it to watch for the current page load to complete. Normally, it waits for the first LOAD_START or NAV_ENTRY_COMMITTED event to switch into the mode where it watches for LOAD_STOP. However, that makes it not so useful for WaitForNavigation, which is intended to be called after triggering the start of a new navigation. This change also makes it so that the cookie prompt supports the automation message box 'OK' and 'Cancel' buttons, so that we can remotely press those buttons. Leveraging all of these changes enables some basic cookie prompting tests to be written. I had to modify browser_frame_win.cc to ensure that BrowserList::SetLastActive is called even while running under remote desktop. R=phajdan.jr@chromium.org BUG=37182 TEST=cookie_modal_dialog_uitest.cc Review URL: http://codereview.chromium.org/661102 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40575 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation/automation_provider.h')
-rw-r--r--chrome/browser/automation/automation_provider.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h
index 24b381a..02b695e 100644
--- a/chrome/browser/automation/automation_provider.h
+++ b/chrome/browser/automation/automation_provider.h
@@ -25,6 +25,7 @@
#include "chrome/browser/browser_list.h"
#include "chrome/browser/history/history.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
+#include "chrome/common/content_settings.h"
#include "chrome/common/notification_registrar.h"
#include "chrome/test/automation/automation_constants.h"
#include "ipc/ipc_message.h"
@@ -77,7 +78,7 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
// RemoveNavigationStatusListener method.
NotificationObserver* AddNavigationStatusListener(
NavigationController* tab, IPC::Message* reply_message,
- int number_of_navigations);
+ int number_of_navigations, bool include_current_navigation);
void RemoveNavigationStatusListener(NotificationObserver* obs);
@@ -232,6 +233,11 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
#if defined(OS_WIN)
void OnBrowserMoved(int handle);
#endif
+ void SetContentSetting(int handle,
+ const std::string& host,
+ ContentSettingsType content_type,
+ ContentSetting setting,
+ bool* success);
#if defined(OS_WIN)
void ScheduleMouseEvent(views::View* view,