| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/app/chrome_command_ids.h" | 5 #include "chrome/app/chrome_command_ids.h" |
| 6 #include "chrome/browser/chrome_notification_types.h" | 6 #include "chrome/browser/chrome_notification_types.h" |
| 7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
| 8 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 8 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
| 10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 web_contents->GetController().Reload(true); | 67 web_contents->GetController().Reload(true); |
| 68 | 68 |
| 69 // Navigate to a page that requires authentication, bringing up another | 69 // Navigate to a page that requires authentication, bringing up another |
| 70 // tab-modal sheet. | 70 // tab-modal sheet. |
| 71 content::NavigationController& controller = web_contents->GetController(); | 71 content::NavigationController& controller = web_contents->GetController(); |
| 72 content::WindowedNotificationObserver observer( | 72 content::WindowedNotificationObserver observer( |
| 73 chrome::NOTIFICATION_AUTH_NEEDED, | 73 chrome::NOTIFICATION_AUTH_NEEDED, |
| 74 content::Source<content::NavigationController>(&controller)); | 74 content::Source<content::NavigationController>(&controller)); |
| 75 browser()->OpenURL(content::OpenURLParams( | 75 browser()->OpenURL(content::OpenURLParams( |
| 76 test_server()->GetURL("auth-basic"), content::Referrer(), CURRENT_TAB, | 76 test_server()->GetURL("auth-basic"), content::Referrer(), CURRENT_TAB, |
| 77 content::PAGE_TRANSITION_TYPED, false)); | 77 ui::PAGE_TRANSITION_TYPED, false)); |
| 78 observer.Wait(); | 78 observer.Wait(); |
| 79 | 79 |
| 80 // Try to reload it again. | 80 // Try to reload it again. |
| 81 web_contents->GetController().Reload(true); | 81 web_contents->GetController().Reload(true); |
| 82 | 82 |
| 83 // Navigate away from the page. We can't use ui_test_utils:NavigateToURL | 83 // Navigate away from the page. We can't use ui_test_utils:NavigateToURL |
| 84 // because that waits for the current page to stop loading first, which won't | 84 // because that waits for the current page to stop loading first, which won't |
| 85 // happen while the auth dialog is up. | 85 // happen while the auth dialog is up. |
| 86 content::TestNavigationObserver navigation_observer(web_contents); | 86 content::TestNavigationObserver navigation_observer(web_contents); |
| 87 browser()->OpenURL(content::OpenURLParams( | 87 browser()->OpenURL(content::OpenURLParams( |
| 88 test_server()->GetURL("bar"), content::Referrer(), CURRENT_TAB, | 88 test_server()->GetURL("bar"), content::Referrer(), CURRENT_TAB, |
| 89 content::PAGE_TRANSITION_TYPED, false)); | 89 ui::PAGE_TRANSITION_TYPED, false)); |
| 90 navigation_observer.Wait(); | 90 navigation_observer.Wait(); |
| 91 } | 91 } |
| OLD | NEW |