| Index: third_party/WebKit/LayoutTests/inspector/elements/styles-2/add-import-rule.html
|
| diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-2/add-import-rule.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/add-import-rule.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ebd85185ecfe0f9acf5b878d1699fb4c6b903e9d
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/add-import-rule.html
|
| @@ -0,0 +1,38 @@
|
| +<!DOCTYPE html>
|
| +<script src="../../../http/tests/inspector/inspector-test.js"></script>
|
| +<script src="../../../http/tests/inspector/elements-test.js"></script>
|
| +<style>span { color: red }</style>
|
| +<script>
|
| +function test() {
|
| +
|
| +var nodeId;
|
| +var sheetId;
|
| +
|
| +InspectorTest.selectNodeAndWaitForStyles("styled-span", nodeSelected);
|
| +
|
| +function nodeSelected(node) {
|
| + nodeId = node.id;
|
| + InspectorTest.cssModel.matchedStylesPromise(nodeId).then(matchedStylesBefore);
|
| +}
|
| +
|
| +function matchedStylesBefore(matchedResult) {
|
| + sheetId = matchedResult.nodeStyles()[1].styleSheetId;
|
| + InspectorTest.addResult("\n== Matched rules before @import added ==\n");
|
| + InspectorTest.dumpSelectedElementStyles(true);
|
| + InspectorTest.CSSAgent.setStyleSheetText(sheetId, "@import 'data:text/css,span{color:green}';").then(sheetTextSet);
|
| +}
|
| +
|
| +function sheetTextSet() {
|
| + InspectorTest.selectNodeAndWaitForStyles("styled-span", matchedStylesAfter);
|
| +}
|
| +
|
| +function matchedStylesAfter() {
|
| + InspectorTest.addResult("\n== Matched rules after @import added ==\n");
|
| + InspectorTest.dumpSelectedElementStyles(true);
|
| + InspectorTest.completeTest();
|
| +}
|
| +
|
| +}
|
| +</script>
|
| +<body onload="runTest()">
|
| +<span id="styled-span"></span>
|
|
|