3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/elements-test.js"></script>
5 <script src=
"../../../http/tests/inspector/debugger-test.js"></script>
10 var inspectorResource
;
12 InspectorTest
.selectNodeAndWaitForStyles("inspected", step1
);
16 InspectorTest
.addNewRule("#inspected", stylesReceived
);
18 function stylesReceived()
20 // UISourceCode.prototype.addRevision() must finish before step2 is called.
21 InspectorTest
.showScriptSource("inspector-stylesheet", step2
);
25 function step2(sourceFrame
)
27 var uiSourceCode
= sourceFrame
._uiSourceCode
;
28 InspectorTest
.addResult("Inspector stylesheet URL: " + uiSourceCode
.displayName());
29 uiSourceCode
.requestContent(printContent());
31 InspectorTest
.addResult("\nSetting new content");
32 uiSourceCode
.setWorkingCopy("#inspected { background-color: green; }");
33 uiSourceCode
.commitWorkingCopy();
37 function step3(uiSourceCode
)
39 uiSourceCode
.requestContent(printContent(selectNode
));
42 InspectorTest
.selectNodeAndWaitForStyles("inspected", dumpStyles
);
47 InspectorTest
.dumpSelectedElementStyles(true, false, true);
48 InspectorTest
.completeTest();
52 function printContent(next
)
54 function result(content
)
56 InspectorTest
.addResult("Inspector stylesheet content:");
57 InspectorTest
.addResult(content
);
67 <body onload=
"runTest()">
69 Tests that adding a new rule creates inspector stylesheet resource and allows its live editing.
72 <div id=
"inspected">Text
</div>