Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2117)

Unified Diff: content/browser/frame_host/navigation_handle_impl_browsertest.cc

Issue 2768873006: Ensure that when a new navigation cancels an existing one, the old navigation's DidFinishNavigati... (Closed)
Patch Set: add test Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/navigation_handle_impl_browsertest.cc
diff --git a/content/browser/frame_host/navigation_handle_impl_browsertest.cc b/content/browser/frame_host/navigation_handle_impl_browsertest.cc
index d92c5dd314bf7dce0f5ddb160e2839ccfd6432f0..cfab72949f7efe7eb83b529aaa595cb1c9bba8ec 100644
--- a/content/browser/frame_host/navigation_handle_impl_browsertest.cc
+++ b/content/browser/frame_host/navigation_handle_impl_browsertest.cc
@@ -1120,6 +1120,22 @@ IN_PROC_BROWSER_TEST_F(NavigationHandleImplBrowserTest, BlockedOnRedirect) {
EXPECT_EQ(finished_navigation, logger.finished_navigation_urls());
}
+// Tests that when a navigation starts while there's an existing one, the first
+// one has the right error code set on its navigation handle.
+IN_PROC_BROWSER_TEST_F(NavigationHandleImplBrowserTest, ErrorCodeOnCancel) {
+ GURL slow_url = embedded_test_server()->GetURL("/slow?60");
+ NavigationHandleObserver observer(shell()->web_contents(), slow_url);
+ shell()->LoadURL(slow_url);
+
+ GURL url2(embedded_test_server()->GetURL("/title1.html"));
+ TestNavigationObserver same_tab_observer(
+ shell()->web_contents(), 1);
+ shell()->LoadURL(url2);
+ same_tab_observer.Wait();
+
+ EXPECT_EQ(net::ERR_ABORTED, observer.net_error_code());
+}
+
// This class allows running tests with PlzNavigate enabled, regardless of
// default test configuration.
class PlzNavigateNavigationHandleImplBrowserTest : public ContentBrowserTest {

Powered by Google App Engine
This is Rietveld 408576698