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

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

Issue 1500973002: This patch adds NextSibling() to FrameTreeNode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased and addressed comment. Created 4 years, 7 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/frame_tree_node.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/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 73861575da410cbf5c09e5957b7e08201d628aa3..2fe94345bfa91169ad805eda86856177bff054a0 100644
--- a/content/browser/frame_host/frame_tree_unittest.cc
+++ b/content/browser/frame_host/frame_tree_unittest.cc
@@ -342,8 +342,8 @@ TEST_F(FrameTreeTest, FindFrames) {
EXPECT_EQ(nullptr, frame_tree->FindByName("no such frame"));
}
-// Check that PreviousSibling() is retrieved correctly.
-TEST_F(FrameTreeTest, PreviousSibling) {
+// Check that PreviousSibling() and NextSibling() are retrieved correctly.
+TEST_F(FrameTreeTest, GetSibling) {
main_test_rfh()->InitializeRenderFrameIfNeeded();
// Add a few child frames to the main frame.
@@ -368,11 +368,19 @@ TEST_F(FrameTreeTest, PreviousSibling) {
blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties());
FrameTreeNode* grandchild = child1->child_at(0);
+ // Test PreviousSibling().
EXPECT_EQ(nullptr, root->PreviousSibling());
EXPECT_EQ(nullptr, child0->PreviousSibling());
EXPECT_EQ(child0, child1->PreviousSibling());
EXPECT_EQ(child1, child2->PreviousSibling());
EXPECT_EQ(nullptr, grandchild->PreviousSibling());
+
+ // Test NextSibling().
+ EXPECT_EQ(nullptr, root->NextSibling());
+ EXPECT_EQ(child1, child0->NextSibling());
+ EXPECT_EQ(child2, child1->NextSibling());
+ EXPECT_EQ(nullptr, child2->NextSibling());
+ EXPECT_EQ(nullptr, grandchild->NextSibling());
}
// Do some simple manipulations of the frame tree, making sure that
« no previous file with comments | « content/browser/frame_host/frame_tree_node.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698