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

Unified Diff: LayoutTests/inspector-protocol/css/css-shadow-host-rule.html

Issue 317703002: DevTools: add test to verify matched styles for :host selector (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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: LayoutTests/inspector-protocol/css/css-shadow-host-rule.html
diff --git a/LayoutTests/inspector-protocol/css/css-shadow-host-rule.html b/LayoutTests/inspector-protocol/css/css-shadow-host-rule.html
new file mode 100644
index 0000000000000000000000000000000000000000..dc551accccffecfab1883ac5b3ab61a805e106c3
--- /dev/null
+++ b/LayoutTests/inspector-protocol/css/css-shadow-host-rule.html
@@ -0,0 +1,40 @@
+<html>
+<head>
+<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
+<script type="text/javascript" src="css-protocol-test.js"></script>
+<script type="text/javascript">
+function test()
+{
+ InspectorTest.sendCommandOrDie("CSS.enable", {}, onCSSEnabled);
+
+ function onCSSEnabled()
+ {
+ InspectorTest.requestNodeId("#shadow-host", onNodeReceived);
+ }
+
+ function onNodeReceived(nodeId)
+ {
+ InspectorTest.loadAndDumpMatchingRulesForNode(nodeId, InspectorTest.completeTest.bind(InspectorTest));
+ }
+}
+</script>
+<template id="shadow-template">
+<style>
+:host {
+ color: red;
+}
+</style>
+<div>Hi!</div>
+</template>
+</head>
+<body>
+ <div id="shadow-host"></div>
+ <script>
+ var host = document.querySelector("#shadow-host").createShadowRoot();
+ var template = document.querySelector("#shadow-template");
+ host.appendChild(template.content);
+ template.remove();
+ runTest();
+ </script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698