summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation
diff options
context:
space:
mode:
authoratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-22 20:34:25 +0000
committeratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-22 20:34:25 +0000
commit100a0095898381f0efb3d441a7f533ed96923042 (patch)
treee9dd922e4e4a20f2dca067e794e5b489b9bf2d2d /chrome/browser/automation
parent6d2721fbdbddd4d35616d9b7774945a3cf42375b (diff)
downloadchromium_src-100a0095898381f0efb3d441a7f533ed96923042.zip
chromium_src-100a0095898381f0efb3d441a7f533ed96923042.tar.gz
chromium_src-100a0095898381f0efb3d441a7f533ed96923042.tar.bz2
Refactored code to allow associating workers with multiple renderers.
SharedWorkers now gracefully handle http auth requests after their initial window has closed. BUG=27660 TEST=WorkerHttpAuth,SharedWorkerHttpAuth uitests Review URL: http://codereview.chromium.org/509016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36888 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r--chrome/browser/automation/automation_provider_observers.cc22
1 files changed, 10 insertions, 12 deletions
diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc
index 03039b1..dfea17c 100644
--- a/chrome/browser/automation/automation_provider_observers.cc
+++ b/chrome/browser/automation/automation_provider_observers.cc
@@ -174,18 +174,16 @@ void NavigationNotificationObserver::Observe(
// occur while authentication is ongoing.
navigation_started_ = true;
} else if (type == NotificationType::AUTH_NEEDED) {
- if (navigation_started_) {
- // Remember the login handler that wants authentication.
- LoginHandler* handler =
- Details<LoginNotificationDetails>(details)->handler();
- automation_->AddLoginHandler(controller_, handler);
-
- // Respond that authentication is needed.
- navigation_started_ = false;
- ConditionMet(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED);
- } else {
- NOTREACHED();
- }
+ // Remember the login handler that wants authentication.
+ // We do this in all cases (not just when navigation_started_ == true) so
+ // tests can still wait for auth dialogs outside of navigation.
+ LoginHandler* handler =
+ Details<LoginNotificationDetails>(details)->handler();
+ automation_->AddLoginHandler(controller_, handler);
+
+ // Respond that authentication is needed.
+ navigation_started_ = false;
+ ConditionMet(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED);
} else {
NOTREACHED();
}