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

Unified Diff: third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh-1.html

Issue 1878123003: DevTools: fix elements-panel-shadow-selection-on-refresh.html (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: split test into many Created 4 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
Index: third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh-1.html
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh-1.html b/third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh-1.html
new file mode 100644
index 0000000000000000000000000000000000000000..fe17e366746c25d32334523c2db002d99fdcf6e1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh-1.html
@@ -0,0 +1,54 @@
+<html>
+<head>
+<script src="../../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../../http/tests/inspector/elements-test.js"></script>
+<script src="./elements-panel-shadow-selection-on-refresh.js"></script>
+<script>
+
+function test()
+{
+ InspectorTest.runTestSuite([
+ function setup(next)
+ {
+ WebInspector.settingForTest("showUAShadowDOM").set(true);
+ InspectorTest.expandElementsTree(next);
+ },
+
+ function testOpenShadowRoot(next)
+ {
+ InspectorTest.findNode(isOpenShadowRoot, InspectorTest.selectReloadAndDump.bind(null, next));
+ },
+
+ function testClosedShadowRoot(next)
+ {
+ InspectorTest.findNode(isClosedShadowRoot, InspectorTest.selectReloadAndDump.bind(null, next));
+ },
+ ]);
+
+ function isOpenShadowRoot(node)
+ {
+ return node && node.shadowRootType() === WebInspector.DOMNode.ShadowRootTypes.Open;
+ }
+
+ function isClosedShadowRoot(node)
+ {
+ return node && node.shadowRootType() === WebInspector.DOMNode.ShadowRootTypes.Closed;
+ }
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests that elements panel preserves selected shadow DOM node on page refresh.
+</p>
+<span id="hostElement"></span><span id="closedHostElement"></span>
+<script>
+var root = document.getElementById("hostElement").createShadowRoot();
+root.innerHTML = "<input type='text'>";
+var closedRoot = document.getElementById("closedHostElement").attachShadow({mode: 'closed'});
+closedRoot.innerHTML = "<button></button>";
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698