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

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

Issue 1070553005: Set frame liveness before calling RenderFrameCreated/RenderFrameDeleted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b444955
Patch Set: Rebase Created 5 years, 8 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/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/frame_tree_unittest.cc
diff --git a/content/browser/frame_host/frame_tree_unittest.cc b/content/browser/frame_host/frame_tree_unittest.cc
index 7cf3428a547a1bb2c2efeb879a8cbf97044701a3..63d450262917ea65cbb75ea093cef4a25b0c17ff 100644
--- a/content/browser/frame_host/frame_tree_unittest.cc
+++ b/content/browser/frame_host/frame_tree_unittest.cc
@@ -29,6 +29,9 @@ namespace {
void AppendTreeNodeState(FrameTreeNode* node, std::string* result) {
result->append(
base::Int64ToString(node->current_frame_host()->GetRoutingID()));
+ if (!node->current_frame_host()->IsRenderFrameLive())
+ result->append("*"); // Asterisk next to dead frames.
+
if (!node->frame_name().empty()) {
result->append(" '");
result->append(node->frame_name());
@@ -202,11 +205,12 @@ TEST_F(FrameTreeTest, DISABLED_Shape) {
// WebContentsObservers see a consistent view of the tree as we go.
TEST_F(FrameTreeTest, ObserverWalksTreeDuringFrameCreation) {
TreeWalkingWebContentsLogger activity(contents());
+ contents()->NavigateAndCommit(GURL("http://www.google.com"));
+ EXPECT_EQ("", activity.GetLog());
+
FrameTree* frame_tree = contents()->GetFrameTree();
FrameTreeNode* root = frame_tree->root();
- EXPECT_EQ("", activity.GetLog());
-
// Simulate attaching a series of frames to build the frame tree.
main_test_rfh()->OnCreateChildFrame(14, std::string(), SandboxFlags::NONE);
EXPECT_EQ(
@@ -228,6 +232,8 @@ TEST_F(FrameTreeTest, ObserverWalksTreeDuringFrameCreation) {
// recovery from a render process crash.
TEST_F(FrameTreeTest, ObserverWalksTreeAfterCrash) {
TreeWalkingWebContentsLogger activity(contents());
+ contents()->NavigateAndCommit(GURL("http://www.google.com"));
+ EXPECT_EQ("", activity.GetLog());
main_test_rfh()->OnCreateChildFrame(22, std::string(), SandboxFlags::NONE);
EXPECT_EQ(
@@ -255,6 +261,7 @@ TEST_F(FrameTreeTest, ObserverWalksTreeAfterCrash) {
// Ensure that frames are not added to the tree, if the process passed in
// is different than the process of the parent node.
TEST_F(FrameTreeTest, FailAddFrameWithWrongProcessId) {
+ contents()->NavigateAndCommit(GURL("http://www.google.com"));
FrameTree* frame_tree = contents()->GetFrameTree();
FrameTreeNode* root = frame_tree->root();
int process_id = root->current_frame_host()->GetProcess()->GetID();
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698