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

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

Issue 372403002: Allow "cross-origin" navigations from about:blank in AreURLsInPageNavigation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: +TODOs Created 6 years, 5 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 | « content/browser/frame_host/navigation_controller_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_controller_impl_unittest.cc
diff --git a/content/browser/frame_host/navigation_controller_impl_unittest.cc b/content/browser/frame_host/navigation_controller_impl_unittest.cc
index ab4d7c5c116ad693753620e787d35c53b9214e67..d03a5500a84a0efced7c571c9252b265256ad40a 100644
--- a/content/browser/frame_host/navigation_controller_impl_unittest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc
@@ -3072,8 +3072,21 @@ TEST_F(NavigationControllerTest, DontShowRendererURLInNewTabAfterCommit) {
// regression for bug 1126349.
TEST_F(NavigationControllerTest, IsInPageNavigation) {
NavigationControllerImpl& controller = controller_impl();
- // Navigate to URL with no refs.
const GURL url("http://www.google.com/home.html");
+
+ // If the renderer claims it performed an in-page navigation from
+ // about:blank, trust the renderer.
+ // This can happen when an iframe is created and populated via
+ // document.write(), then tries to perform a fragment navigation.
+ // TODO(japhet): We should only trust the renderer if the about:blank
+ // was the first document in the given frame, but we don't have enough
+ // information to identify that case currently.
+ const GURL blank_url(url::kAboutBlankURL);
+ main_test_rfh()->SendNavigate(0, blank_url);
+ EXPECT_TRUE(controller.IsURLInPageNavigation(url, true,
+ main_test_rfh()));
+
+ // Navigate to URL with no refs.
main_test_rfh()->SendNavigate(0, url);
// Reloading the page is not an in-page navigation.
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698