Chromium Code Reviews| Index: content/browser/browser_side_navigation_browsertest.cc |
| diff --git a/content/browser/browser_side_navigation_browsertest.cc b/content/browser/browser_side_navigation_browsertest.cc |
| index 4bba0ee76dd9ff4a14b2d8efa812661ab8df9df6..5c170888197bbc34fea16c203c532ec64ad98f37 100644 |
| --- a/content/browser/browser_side_navigation_browsertest.cc |
| +++ b/content/browser/browser_side_navigation_browsertest.cc |
| @@ -159,4 +159,27 @@ IN_PROC_BROWSER_TEST_F(BrowserSideNavigationBrowserTest, |
| ->GetFrameTree()->root()->current_frame_host()); |
| } |
| +// Ensure that browser side navigation handles navigation failures. |
| +IN_PROC_BROWSER_TEST_F(BrowserSideNavigationBrowserTest, FailedNavigation) { |
| + // Perform a navigation with no live renderer. |
| + { |
| + TestNavigationObserver observer(shell()->web_contents()); |
| + GURL url(embedded_test_server()->GetURL("/title1.html")); |
| + NavigateToURL(shell(), url); |
| + EXPECT_EQ(url, observer.last_navigation_url()); |
| + EXPECT_TRUE(observer.last_navigation_succeeded()); |
| + } |
| + |
| + // Now navigate to an unreachable url. |
| + { |
| + TestNavigationObserver observer(shell()->web_contents()); |
| + GURL url("http://127.0.0.1:4"); |
|
clamy
2015/04/10 14:04:49
The url was chosen to get a network error (otherwi
Charlie Reis
2015/04/10 22:54:44
I think we have better ways to do this. Please se
clamy
2015/04/14 11:56:25
Done.
|
| + NavigateToURL(shell(), url); |
| + EXPECT_EQ(url, observer.last_navigation_url()); |
| + EXPECT_EQ(1, observer.navigations_failed()); |
| + // TODO(clamy): when start/stop loading events are properly reported, update |
| + // this test to check for the status of the last navigation. |
| + } |
| +} |
| + |
| } // namespace content |