| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_commands.h" | 10 #include "chrome/browser/ui/browser_commands.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // Navigates away from NTP before it commits, in process-per-tab mode. | 71 // Navigates away from NTP before it commits, in process-per-tab mode. |
| 72 // Ensures that we don't load the normal page in the NTP process (and thus | 72 // Ensures that we don't load the normal page in the NTP process (and thus |
| 73 // crash), as in http://crbug.com/69224. | 73 // crash), as in http://crbug.com/69224. |
| 74 // If this flakes, use http://crbug.com/87200 | 74 // If this flakes, use http://crbug.com/87200 |
| 75 IN_PROC_BROWSER_TEST_F(NewTabUIProcessPerTabTest, NavBeforeNTPCommits) { | 75 IN_PROC_BROWSER_TEST_F(NewTabUIProcessPerTabTest, NavBeforeNTPCommits) { |
| 76 // Bring up a new tab page. | 76 // Bring up a new tab page. |
| 77 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); | 77 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); |
| 78 | 78 |
| 79 // Navigate to chrome://hang/ to stall the process. | 79 // Navigate to chrome://hang/ to stall the process. |
| 80 ui_test_utils::NavigateToURLWithDisposition( | 80 ui_test_utils::NavigateToURLWithDisposition( |
| 81 browser(), GURL(content::kChromeUIHangURL), CURRENT_TAB, 0); | 81 browser(), GURL(content::kChromeUIHangURL), |
| 82 WindowOpenDisposition::CURRENT_TAB, 0); |
| 82 | 83 |
| 83 // Visit a normal URL in another NTP that hasn't committed. | 84 // Visit a normal URL in another NTP that hasn't committed. |
| 84 ui_test_utils::NavigateToURLWithDisposition( | 85 ui_test_utils::NavigateToURLWithDisposition( |
| 85 browser(), GURL(chrome::kChromeUINewTabURL), NEW_FOREGROUND_TAB, 0); | 86 browser(), GURL(chrome::kChromeUINewTabURL), |
| 87 WindowOpenDisposition::NEW_FOREGROUND_TAB, 0); |
| 86 | 88 |
| 87 // We don't use ui_test_utils::NavigateToURLWithDisposition because that waits | 89 // We don't use ui_test_utils::NavigateToURLWithDisposition because that waits |
| 88 // for current loading to stop. | 90 // for current loading to stop. |
| 89 content::TestNavigationObserver observer( | 91 content::TestNavigationObserver observer( |
| 90 browser()->tab_strip_model()->GetActiveWebContents()); | 92 browser()->tab_strip_model()->GetActiveWebContents()); |
| 91 browser()->OpenURL(OpenURLParams( | 93 browser()->OpenURL(OpenURLParams( |
| 92 GURL("data:text/html,hello world"), Referrer(), CURRENT_TAB, | 94 GURL("data:text/html,hello world"), Referrer(), |
| 93 ui::PAGE_TRANSITION_TYPED, false)); | 95 WindowOpenDisposition::CURRENT_TAB, ui::PAGE_TRANSITION_TYPED, false)); |
| 94 observer.Wait(); | 96 observer.Wait(); |
| 95 } | 97 } |
| OLD | NEW |