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

Unified Diff: content/browser/web_contents/web_contents_impl_unittest.cc

Issue 23841002: Create a new RenderFrameHost per child frame when --site-per-process is enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: notify observers regardless of flag Created 7 years, 3 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
Index: content/browser/web_contents/web_contents_impl_unittest.cc
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc
index aded7ae002fe4e2db15d7c3e77498d79b0db2460..706fde192c0fe953fe39032f8857543a7d513829 100644
--- a/content/browser/web_contents/web_contents_impl_unittest.cc
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -7,7 +7,6 @@
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/renderer_host/test_render_view_host.h"
#include "content/browser/site_instance_impl.h"
-#include "content/browser/web_contents/frame_tree_node.h"
#include "content/browser/web_contents/interstitial_page_impl.h"
#include "content/browser/web_contents/navigation_entry_impl.h"
#include "content/browser/webui/web_ui_controller_factory_registry.h"
@@ -2144,82 +2143,4 @@ TEST_F(WebContentsImplTest, PendingContents) {
EXPECT_EQ(NULL, contents()->GetCreatedWindow(route_id));
}
-// This test asserts the shape of the frame tree is correct, based on incoming
-// frame attached/detached messages.
-TEST_F(WebContentsImplTest, FrameTreeShape) {
- std::string no_children_node("no children node");
- std::string deep_subtree("node with deep subtree");
-
- // The initial navigation will create a frame_tree_root_ node with the top
- // level frame id. Simulate that by just creating it here.
- contents()->frame_tree_root_.reset(
- new FrameTreeNode(5, std::string("top-level")));
-
- // Let's send a series of messages for frame attached and build the
- // frame tree.
- contents()->OnFrameAttached(5, 14, std::string());
- contents()->OnFrameAttached(5, 15, std::string());
- contents()->OnFrameAttached(5, 16, std::string());
-
- contents()->OnFrameAttached(14, 244, std::string());
- contents()->OnFrameAttached(14, 245, std::string());
-
- contents()->OnFrameAttached(15, 255, no_children_node);
-
- contents()->OnFrameAttached(16, 264, std::string());
- contents()->OnFrameAttached(16, 265, std::string());
- contents()->OnFrameAttached(16, 266, std::string());
- contents()->OnFrameAttached(16, 267, deep_subtree);
- contents()->OnFrameAttached(16, 268, std::string());
-
- contents()->OnFrameAttached(267, 365, std::string());
- contents()->OnFrameAttached(365, 455, std::string());
- contents()->OnFrameAttached(455, 555, std::string());
- contents()->OnFrameAttached(555, 655, std::string());
-
- // Now, verify the tree structure is as expected.
- FrameTreeNode* root = contents()->frame_tree_root_.get();
- EXPECT_EQ(5, root->frame_id());
- EXPECT_EQ(3UL, root->child_count());
-
- EXPECT_EQ(2UL, root->child_at(0)->child_count());
- EXPECT_EQ(0UL, root->child_at(0)->child_at(0)->child_count());
- EXPECT_EQ(0UL, root->child_at(0)->child_at(1)->child_count());
-
- EXPECT_EQ(1UL, root->child_at(1)->child_count());
- EXPECT_EQ(0UL, root->child_at(1)->child_at(0)->child_count());
- EXPECT_STREQ(no_children_node.c_str(),
- root->child_at(1)->child_at(0)->frame_name().c_str());
-
- EXPECT_EQ(5UL, root->child_at(2)->child_count());
- EXPECT_EQ(0UL, root->child_at(2)->child_at(0)->child_count());
- EXPECT_EQ(0UL, root->child_at(2)->child_at(1)->child_count());
- EXPECT_EQ(0UL, root->child_at(2)->child_at(2)->child_count());
- EXPECT_EQ(1UL, root->child_at(2)->child_at(3)->child_count());
- EXPECT_STREQ(deep_subtree.c_str(),
- root->child_at(2)->child_at(3)->frame_name().c_str());
- EXPECT_EQ(0UL, root->child_at(2)->child_at(4)->child_count());
-
- FrameTreeNode* deep_tree = root->child_at(2)->child_at(3)->child_at(0);
- EXPECT_EQ(365, deep_tree->frame_id());
- EXPECT_EQ(1UL, deep_tree->child_count());
- EXPECT_EQ(455, deep_tree->child_at(0)->frame_id());
- EXPECT_EQ(1UL, deep_tree->child_at(0)->child_count());
- EXPECT_EQ(555, deep_tree->child_at(0)->child_at(0)->frame_id());
- EXPECT_EQ(1UL, deep_tree->child_at(0)->child_at(0)->child_count());
- EXPECT_EQ(655, deep_tree->child_at(0)->child_at(0)->child_at(0)->frame_id());
- EXPECT_EQ(0UL,
- deep_tree->child_at(0)->child_at(0)->child_at(0)->child_count());
-
- // Test removing of nodes.
- contents()->OnFrameDetached(555, 655);
- EXPECT_EQ(0UL, deep_tree->child_at(0)->child_at(0)->child_count());
-
- contents()->OnFrameDetached(16, 265);
- EXPECT_EQ(4UL, root->child_at(2)->child_count());
-
- contents()->OnFrameDetached(5, 15);
- EXPECT_EQ(2UL, root->child_count());
-}
-
} // namespace content
« no previous file with comments | « content/browser/web_contents/web_contents_impl_browsertest.cc ('k') | content/common/content_message_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698