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

Unified Diff: third_party/WebKit/LayoutTests/inspector/elements/shadow/create-shadow-root.html

Issue 2347963002: [DevTools] Show distribution for Shadow DOM V1. (Closed)
Patch Set: getDistributedNodes -> iteration Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/elements/shadow/create-shadow-root-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/inspector/elements/shadow/create-shadow-root.html
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/shadow/create-shadow-root.html b/third_party/WebKit/LayoutTests/inspector/elements/shadow/create-shadow-root.html
index 4775077bea72cdd1d8366366cf2a575b1b62d906..60d9b52e907fddfc8a0f2f52fea750150e96f4d4 100644
--- a/third_party/WebKit/LayoutTests/inspector/elements/shadow/create-shadow-root.html
+++ b/third_party/WebKit/LayoutTests/inspector/elements/shadow/create-shadow-root.html
@@ -11,48 +11,55 @@ function createShadowRoot(id)
root.innerHTML = "<div id='" + id + "'></div>";
}
-function test()
+function createShadowRootV1(containerId, id, mode)
{
- var containerNode;
+ var container = document.getElementById(containerId);
+ var root = container.attachShadow({ mode: mode });
+ root.innerHTML = "<div id='" + id + "'></div>";
+}
+function test()
+{
InspectorTest.runTestSuite([
- function testDumpInitial(next)
+ function testCreateShadowRoot(next)
{
- function callback(node)
- {
- containerNode = InspectorTest.expandedNodeWithId("container");
- expandAndDumpContainerNode("========= Original ========", next)();
- }
- InspectorTest.expandElementsTree(callback);
+ testShadowRoot("container", "createShadowRoot('shadow-1')", next);
},
- function testCreateShadowRoot(next)
+ function testCreateSecondShadowRoot(next)
{
- InspectorTest.evaluateInPage(
- "createShadowRoot('shadow-1')",
- expandAndDumpContainerNode("===== After createShadowRoot =====", next));
+ testShadowRoot("container", "createShadowRoot('shadow-2')", next);
},
- function testCreateSecondShadowRoot(next)
+ function testCreateOpenShadowRoot(next)
{
- InspectorTest.evaluateInPage(
- "createShadowRoot('shadow-2')",
- expandAndDumpContainerNode("===== After second createShadowRoot =====", next));
- }
+ testShadowRoot("containerOpen", "createShadowRootV1('containerOpen', 'shadow-3', 'open')", next);
+ },
+
+ function testCreateCloseShadowRoot(next)
+ {
+ testShadowRoot("containerClosed", "createShadowRootV1('containerClosed', 'shadow-4', 'closed')", next);
+ },
]);
- function expandAndDumpContainerNode(title, next)
+ function testShadowRoot(containerId, code, next)
{
- return function()
+ var containerNode;
+ InspectorTest.expandElementsTree(dumpBefore);
+
+ function dumpBefore()
{
- InspectorTest.addResult(title);
- InspectorTest.expandElementsTree(callback);
+ containerNode = InspectorTest.expandedNodeWithId(containerId);
+ InspectorTest.addResult("==== before ====");
+ InspectorTest.dumpElementsTree(containerNode);
+ InspectorTest.evaluateInPage(code, InspectorTest.expandElementsTree.bind(InspectorTest, dumpAfter));
+ }
- function callback()
- {
- InspectorTest.dumpElementsTree(containerNode);
- next();
- }
+ function dumpAfter()
+ {
+ InspectorTest.addResult("==== after ====");
+ InspectorTest.dumpElementsTree(containerNode);
+ next();
}
}
}
@@ -66,6 +73,8 @@ Tests that elements panel updates dom tree structure upon shadow root creation.
</p>
<div id="container"><div id="child"></div></div>
+<div id="containerOpen"><div id="childOpen"></div></div>
+<div id="containerClosed"><div id="childClosed"></div></div>
</body>
</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/elements/shadow/create-shadow-root-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698