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

Unified Diff: sky/engine/core/dom/TreeScopeTest.cpp

Issue 759663003: Only allow one shadowRoot. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: ojan review. Created 6 years, 1 month 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 | « sky/engine/core/dom/TreeScopeAdopter.cpp ('k') | sky/engine/core/dom/shadow/ComposedTreeWalker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/TreeScopeTest.cpp
diff --git a/sky/engine/core/dom/TreeScopeTest.cpp b/sky/engine/core/dom/TreeScopeTest.cpp
index d943d16f49a20f1f8e1694bdc2531d7db3b35945..c8ca79cd827d17631ea04933a17d5034285fbdbf 100644
--- a/sky/engine/core/dom/TreeScopeTest.cpp
+++ b/sky/engine/core/dom/TreeScopeTest.cpp
@@ -21,7 +21,7 @@ TEST(TreeScopeTest, CommonAncestorOfSameTrees)
RefPtr<Element> html = document->createElement("html", nullAtom, ASSERT_NO_EXCEPTION);
document->appendChild(html, ASSERT_NO_EXCEPTION);
- RefPtr<ShadowRoot> shadowRoot = html->createShadowRoot(ASSERT_NO_EXCEPTION);
+ RefPtr<ShadowRoot> shadowRoot = html->ensureShadowRoot(ASSERT_NO_EXCEPTION);
EXPECT_EQ(shadowRoot.get(), shadowRoot->commonAncestorTreeScope(*shadowRoot));
}
@@ -34,7 +34,7 @@ TEST(TreeScopeTest, CommonAncestorOfInclusiveTrees)
RefPtr<Document> document = Document::create();
RefPtr<Element> html = document->createElement("html", nullAtom, ASSERT_NO_EXCEPTION);
document->appendChild(html, ASSERT_NO_EXCEPTION);
- RefPtr<ShadowRoot> shadowRoot = html->createShadowRoot(ASSERT_NO_EXCEPTION);
+ RefPtr<ShadowRoot> shadowRoot = html->ensureShadowRoot(ASSERT_NO_EXCEPTION);
EXPECT_EQ(document.get(), document->commonAncestorTreeScope(*shadowRoot));
EXPECT_EQ(document.get(), shadowRoot->commonAncestorTreeScope(*document));
@@ -54,8 +54,8 @@ TEST(TreeScopeTest, CommonAncestorOfSiblingTrees)
RefPtr<Element> body = document->createElement("body", nullAtom, ASSERT_NO_EXCEPTION);
html->appendChild(body);
- RefPtr<ShadowRoot> shadowRootA = head->createShadowRoot(ASSERT_NO_EXCEPTION);
- RefPtr<ShadowRoot> shadowRootB = body->createShadowRoot(ASSERT_NO_EXCEPTION);
+ RefPtr<ShadowRoot> shadowRootA = head->ensureShadowRoot(ASSERT_NO_EXCEPTION);
+ RefPtr<ShadowRoot> shadowRootB = body->ensureShadowRoot(ASSERT_NO_EXCEPTION);
EXPECT_EQ(document.get(), shadowRootA->commonAncestorTreeScope(*shadowRootB));
EXPECT_EQ(document.get(), shadowRootB->commonAncestorTreeScope(*shadowRootA));
@@ -77,12 +77,12 @@ TEST(TreeScopeTest, CommonAncestorOfTreesAtDifferentDepths)
RefPtr<Element> body = document->createElement("body", nullAtom, ASSERT_NO_EXCEPTION);
html->appendChild(body);
- RefPtr<ShadowRoot> shadowRootY = head->createShadowRoot(ASSERT_NO_EXCEPTION);
- RefPtr<ShadowRoot> shadowRootB = body->createShadowRoot(ASSERT_NO_EXCEPTION);
+ RefPtr<ShadowRoot> shadowRootY = head->ensureShadowRoot(ASSERT_NO_EXCEPTION);
+ RefPtr<ShadowRoot> shadowRootB = body->ensureShadowRoot(ASSERT_NO_EXCEPTION);
RefPtr<Element> divInY = document->createElement("div", nullAtom, ASSERT_NO_EXCEPTION);
shadowRootY->appendChild(divInY);
- RefPtr<ShadowRoot> shadowRootA = divInY->createShadowRoot(ASSERT_NO_EXCEPTION);
+ RefPtr<ShadowRoot> shadowRootA = divInY->ensureShadowRoot(ASSERT_NO_EXCEPTION);
EXPECT_EQ(document.get(), shadowRootA->commonAncestorTreeScope(*shadowRootB));
EXPECT_EQ(document.get(), shadowRootB->commonAncestorTreeScope(*shadowRootA));
« no previous file with comments | « sky/engine/core/dom/TreeScopeAdopter.cpp ('k') | sky/engine/core/dom/shadow/ComposedTreeWalker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698