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

Unified Diff: Source/wtf/TreeNodeTest.cpp

Issue 238923009: HTML Imports: No more BlockingDocumentCreation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased to ToT. Created 6 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 | « Source/wtf/TreeNode.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/TreeNodeTest.cpp
diff --git a/Source/wtf/TreeNodeTest.cpp b/Source/wtf/TreeNodeTest.cpp
index 0362e6fbeb191915eb2dedba3c438caddd334cb5..d793c2d45a59b2963e1e07e1d6b7a7f1c35fe2e1 100644
--- a/Source/wtf/TreeNodeTest.cpp
+++ b/Source/wtf/TreeNodeTest.cpp
@@ -168,6 +168,21 @@ TEST(WTF, TreeNodeRemoveFirst)
EXPECT_EQ(trio.root->lastChild(), trio.lastChild.get());
}
+TEST(WTF, TreeNodeTakeChildrenFrom)
+{
+ RefPtr<TestTree> newParent = TestTree::create();
+ Trio trio;
+ trio.appendChildren();
+
+ newParent->takeChildrenFrom(trio.root.get());
+
+ EXPECT_FALSE(trio.root->hasChildren());
+ EXPECT_TRUE(newParent->hasChildren());
+ EXPECT_EQ(trio.firstChild.get(), newParent->firstChild());
+ EXPECT_EQ(trio.middleChild.get(), newParent->firstChild()->next());
+ EXPECT_EQ(trio.lastChild.get(), newParent->lastChild());
+}
+
class TrioWithGrandChild : public Trio {
public:
TrioWithGrandChild()
« no previous file with comments | « Source/wtf/TreeNode.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698