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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/bindings/shadowdom-navigator.html

Issue 2777633002: DevTools: add bindings tests to fixate shadowDOM behavior. (Closed)
Patch Set: Created 3 years, 9 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/http/tests/inspector/bindings/shadowdom-navigator.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/shadowdom-navigator.html b/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/shadowdom-navigator.html
new file mode 100644
index 0000000000000000000000000000000000000000..92ba0387bd890755dc216d340d8116e362d28ba0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/shadowdom-navigator.html
@@ -0,0 +1,73 @@
+<html>
+<head>
+<script src="../inspector-test.js"></script>
+<script src="./bindings-test.js"></script>
+
+<script>
+
+async function test()
+{
+ var sourcesNavigator = new Sources.SourcesNavigatorView();
+ sourcesNavigator.show(UI.inspectorView.element);
+
+ InspectorTest.markStep('dumpInitialNavigator');
+ InspectorTest.dumpNavigatorView(sourcesNavigator, false);
+
+ InspectorTest.markStep('attachShadow1');
+ await Promise.all([
+ InspectorTest.attachShadowDOM('shadow1', '#template'),
+ InspectorTest.waitForSourceMap('sourcemap-script.js.map'),
+ InspectorTest.waitForSourceMap('sourcemap-style.css.map'),
+ ]);
+ InspectorTest.dumpNavigatorView(sourcesNavigator, false);
+
+ InspectorTest.markStep('attachShadow2');
+ await Promise.all([
+ InspectorTest.attachShadowDOM('shadow2', '#template'),
+ InspectorTest.waitForSourceMap('sourcemap-script.js.map'),
+ InspectorTest.waitForSourceMap('sourcemap-style.css.map'),
+ ]);
+ InspectorTest.dumpNavigatorView(sourcesNavigator, false);
+
+ InspectorTest.markStep('detachShadow1');
+ await Promise.all([
+ InspectorTest.detachShadowDOM('shadow1'),
+ InspectorTest.waitForStyleSheetRemoved('sourcemap-style.css'),
+ ]);
+ InspectorTest.dumpNavigatorView(sourcesNavigator, false);
+
+ InspectorTest.markStep('detachShadow2');
+ await Promise.all([
+ InspectorTest.detachShadowDOM('shadow2'),
+ InspectorTest.waitForStyleSheetRemoved('sourcemap-style.css'),
+ ]);
+ InspectorTest.dumpNavigatorView(sourcesNavigator, false);
+
+ InspectorTest.completeTest();
+}
+
+</script>
+
+</head>
+<body onload="runTest()">
+<p>
+Verify that navigator shows proper UISourceCodes as shadow dom
+styles and scripts are added and removed.
+</p>
+
+<template id='template'>
+<style>div {
+ color: blue;
+}
+/*# sourceURL=sourcemap-style.css */
+/*# sourceMappingURL=resources/sourcemap-style.css.map */
+</style>
+<script>window.foo = console.log.bind(console, 'foo');
+//# sourceURL=sourcemap-script.js
+//# sourceMappingURL=resources/sourcemap-script.js.map
+</script>
+<p>Hi! I'm ShadowDOM v1!</p>
+</template>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698