| 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/net/url_fixer_upper.h" | 6 #include "chrome/browser/net/url_fixer_upper.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/browser/ui/web_contents_modal_dialog_manager.h" | 9 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" |
| 10 #include "chrome/common/chrome_notification_types.h" | 10 #include "chrome/common/chrome_notification_types.h" |
| 11 #include "chrome/common/url_constants.h" | 11 #include "chrome/common/url_constants.h" |
| 12 #include "chrome/test/base/in_process_browser_test.h" | 12 #include "chrome/test/base/in_process_browser_test.h" |
| 13 #include "chrome/test/base/ui_test_utils.h" | 13 #include "chrome/test/base/ui_test_utils.h" |
| 14 #include "chrome/test/ui/ui_test.h" | 14 #include "chrome/test/ui/ui_test.h" |
| 15 #include "content/public/browser/navigation_controller.h" | 15 #include "content/public/browser/navigation_controller.h" |
| 16 #include "content/public/browser/web_contents.h" | 16 #include "content/public/browser/web_contents.h" |
| 17 #include "content/public/test/test_navigation_observer.h" | 17 #include "content/public/test/test_navigation_observer.h" |
| 18 #include "net/test/spawned_test_server.h" | 18 #include "net/test/spawned_test_server/spawned_test_server.h" |
| 19 | 19 |
| 20 typedef InProcessBrowserTest RepostFormWarningTest; | 20 typedef InProcessBrowserTest RepostFormWarningTest; |
| 21 | 21 |
| 22 // If becomes flaky, disable on Windows and use http://crbug.com/47228 | 22 // If becomes flaky, disable on Windows and use http://crbug.com/47228 |
| 23 IN_PROC_BROWSER_TEST_F(RepostFormWarningTest, TestDoubleReload) { | 23 IN_PROC_BROWSER_TEST_F(RepostFormWarningTest, TestDoubleReload) { |
| 24 ASSERT_TRUE(test_server()->Start()); | 24 ASSERT_TRUE(test_server()->Start()); |
| 25 | 25 |
| 26 // Load a form. | 26 // Load a form. |
| 27 ui_test_utils::NavigateToURL( | 27 ui_test_utils::NavigateToURL( |
| 28 browser(), test_server()->GetURL("files/form.html")); | 28 browser(), test_server()->GetURL("files/form.html")); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::Source<content::NavigationController> source(&controller); | 86 content::Source<content::NavigationController> source(&controller); |
| 87 content::TestNavigationObserver navigation_observer(source); | 87 content::TestNavigationObserver navigation_observer(source); |
| 88 browser()->OpenURL(content::OpenURLParams( | 88 browser()->OpenURL(content::OpenURLParams( |
| 89 test_server()->GetURL("bar"), content::Referrer(), CURRENT_TAB, | 89 test_server()->GetURL("bar"), content::Referrer(), CURRENT_TAB, |
| 90 content::PAGE_TRANSITION_TYPED, false)); | 90 content::PAGE_TRANSITION_TYPED, false)); |
| 91 navigation_observer.Wait(); | 91 navigation_observer.Wait(); |
| 92 } | 92 } |
| OLD | NEW |