Index: content/browser/frame_host/navigator_impl_unittest.cc |
diff --git a/content/browser/frame_host/navigator_impl_unittest.cc b/content/browser/frame_host/navigator_impl_unittest.cc |
index d265010d48eb50848c73d2510a3c7136ee9d891e..d1120058f4e685358d7a5ce125e4c913f66fdc2d 100644 |
--- a/content/browser/frame_host/navigator_impl_unittest.cc |
+++ b/content/browser/frame_host/navigator_impl_unittest.cc |
@@ -258,14 +258,16 @@ TEST_F(NavigatorTestWithBrowserSideNavigation, |
EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); |
} |
-// PlzNavigate: Test that a proper NavigationRequest is created by |
-// RequestNavigation. |
-TEST_F(NavigatorTestWithBrowserSideNavigation, BeginNavigation) { |
+// PlzNavigate: Test that navigation state is properly maintained when |
+// navigating simultaneously at the root frame and at a subframe levels. |
+TEST_F(NavigatorTestWithBrowserSideNavigation, |
clamy
2015/04/27 12:05:20
Note that the original goal of this test is to che
|
+ NavigatingAtRootAndSubframeSimultaneously) { |
const GURL kUrl1("http://www.google.com/"); |
const GURL kUrl2("http://www.chromium.org/"); |
const GURL kUrl3("http://www.gmail.com/"); |
contents()->NavigateAndCommit(kUrl1); |
+ process()->sink().ClearMessages(); |
// Add a subframe. |
FrameTreeNode* root_node = contents()->GetFrameTree()->root(); |
@@ -331,12 +333,24 @@ TEST_F(NavigatorTestWithBrowserSideNavigation, BeginNavigation) { |
// As the main frame hasn't yet committed the subframe still exists. Thus, the |
// above situation regarding subframe navigations is valid here. |
+ ASSERT_TRUE(subframe_node->navigation_request()); |
if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
switches::kSitePerProcess)) { |
EXPECT_TRUE(GetSpeculativeRenderFrameHost(subframe_node)); |
} else { |
EXPECT_FALSE(GetSpeculativeRenderFrameHost(subframe_node)); |
} |
+ |
+ // Have the navigation commit for the root node's speculative RenderFrameHost. |
clamy
2015/04/27 12:05:20
This comment is misleading. If you want to simulat
|
+ scoped_refptr<ResourceResponse> response(new ResourceResponse); |
+ main_loader->CallOnResponseStarted(response, MakeEmptyStream()); |
+ TestRenderFrameHost* speculative_root_rfh = |
+ GetSpeculativeRenderFrameHost(root_node); |
+ ASSERT_TRUE(speculative_root_rfh); |
+ EXPECT_TRUE(DidRenderFrameHostRequestCommit(speculative_root_rfh)); |
+ |
+ // The subframe request is still there as the subframe still exists. |
+ ASSERT_TRUE(subframe_node->navigation_request()); |
} |
// PlzNavigate: Test that committing an HTTP 204 or HTTP 205 response cancels |