summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation
diff options
context:
space:
mode:
authorhuanr@chromium.org <huanr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-13 18:41:39 +0000
committerhuanr@chromium.org <huanr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-13 18:41:39 +0000
commit27e1c9e03d66d18f1cd42a5355735206dfa1bfec (patch)
treec9e0ca8ca0fa4331d73162b0ebf77892348e0b00 /chrome/browser/automation
parent279cc48f803ddf0de28e5ea700ad2132f2aecd56 (diff)
downloadchromium_src-27e1c9e03d66d18f1cd42a5355735206dfa1bfec.zip
chromium_src-27e1c9e03d66d18f1cd42a5355735206dfa1bfec.tar.gz
chromium_src-27e1c9e03d66d18f1cd42a5355735206dfa1bfec.tar.bz2
Making navigate, back, forward, and reload
synchronous in automated ui test. Review URL: http://codereview.chromium.org/115279 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15978 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r--chrome/browser/automation/automation_provider.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index 30a52ff..69ea1e9 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -245,7 +245,6 @@ class NavigationNotificationObserver : public NotificationObserver {
automation_->Send(reply_message_);
reply_message_ = NULL;
- automation_->RemoveNavigationStatusListener(this);
delete this;
}
@@ -260,6 +259,8 @@ class NavigationNotificationObserver : public NotificationObserver {
reply_message_ = NULL;
}
+ automation_->RemoveNavigationStatusListener(this);
+
NotificationService* service = NotificationService::current();
service->RemoveObserver(this, NotificationType::NAV_ENTRY_COMMITTED,
Source<NavigationController>(controller_));
@@ -569,6 +570,18 @@ class ExecuteBrowserCommandObserver : public NotificationObserver {
observer->set_for_browser_command(true);
break;
}
+ case IDC_BACK:
+ case IDC_FORWARD:
+ case IDC_RELOAD: {
+ automation->
+ AddNavigationStatusListener<AutomationMsg_NavigationResponseValues>(
+ &browser->GetSelectedTabContents()->controller(),
+ reply_message,
+ AUTOMATION_MSG_NAVIGATION_SUCCESS,
+ AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ AUTOMATION_MSG_NAVIGATION_ERROR);
+ break;
+ }
default: {
ExecuteBrowserCommandObserver* observer =
new ExecuteBrowserCommandObserver(automation, reply_message);