+// Ensure that IsRenderFrameLive is true for main frames and same-site iframes.
+IN_PROC_BROWSER_TEST_F(FrameTreeBrowserTest, IsRenderFrameLive) {
+ host_resolver()->AddRule("*", "127.0.0.1");
+ ASSERT_TRUE(test_server()->Start());
+ GURL main_url(test_server()->GetURL("files/frame_tree/top.html"));
+ NavigateToURL(shell(), main_url);
+
+ // It is safe to obtain the root frame tree node here, as it doesn't change.
+ FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents())
+ ->GetFrameTree()->root();
+
+ // The root and subframe should each have a live RenderFrame.
+ EXPECT_TRUE(
+ root->current_frame_host()->render_view_host()->IsRenderViewLive());
+ EXPECT_TRUE(root->current_frame_host()->IsRenderFrameLive());
+ EXPECT_TRUE(root->child_at(0)->current_frame_host()->IsRenderFrameLive());
+
+ // Load a same-site page into iframe and it should still be live.
+ GURL http_url(test_server()->GetURL("files/title1.html"));
+ NavigateFrameToURL(root->child_at(0), http_url);
+ EXPECT_TRUE(
+ root->current_frame_host()->render_view_host()->IsRenderViewLive());
+ EXPECT_TRUE(root->current_frame_host()->IsRenderFrameLive());
+ EXPECT_TRUE(root->child_at(0)->current_frame_host()->IsRenderFrameLive());
+}
+