diff options
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r-- | chrome/browser/automation/automation_provider_observers.cc | 22 |
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(); } |