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

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

Issue 2695093006: Remove one navigation layout test (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | content/test/data/page204.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_controller_impl_browsertest.cc
diff --git a/content/browser/frame_host/navigation_controller_impl_browsertest.cc b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
index 8ea87f7e0a15f2f913e0afa9dc61199e9f9d33e1..6e9206329c415de1fe6174aa06a76724c10ccde5 100644
--- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -6737,4 +6737,30 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
EXPECT_FALSE(handle_observer.was_renderer_initiated());
}
+// Tests that a 204 response to a browser-initiated navigation does not result
+// in a new NavigationEntry being committed.
+IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
+ 204Navigation) {
+ const GURL kURL = embedded_test_server()->GetURL("/title1.html");
+ const GURL kURL204 = embedded_test_server()->GetURL("/page204.html");
+
+ // Navigate to the initial page.
+ EXPECT_TRUE(NavigateToURL(shell(), kURL));
+
+ const NavigationControllerImpl& controller =
+ static_cast<const NavigationControllerImpl&>(
+ shell()->web_contents()->GetController());
+
+ NavigationEntryImpl* entry = controller.GetLastCommittedEntry();
+ EXPECT_EQ(kURL, entry->GetURL());
+ EXPECT_EQ(1, controller.GetEntryCount());
+
+ // Do a 204 navigation.
+ EXPECT_FALSE(NavigateToURL(shell(), kURL204));
+
+ entry = controller.GetLastCommittedEntry();
+ EXPECT_EQ(kURL, entry->GetURL());
+ EXPECT_EQ(1, controller.GetEntryCount());
+}
+
} // namespace content
« no previous file with comments | « no previous file | content/test/data/page204.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698