4 <style type="text/css" media="screen">
5 #main { background:blue; }
8 <script src="../../http/tests/inspector/inspector-test.js"></script>
9 <script src="../../http/tests/inspector/elements-test.js"></script>
12 function injectStyleSheet()
14 var styleSheet = "#main { color: red; -webkit-border-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAiElEQVR42r2RsQrDMAxEBRdl8SDcX8lQPGg1GBI6lvz/h7QyRRXV0qUULwfvwZ1tenw5PxToRPWMC52eA9+WDnlh3HFQ/xBQl86NFYJqeGflkiogrOvVlIFhqURFVho3x1moGAa3deMs+LS30CAhBN5nNxeT5hbJ1zwmji2k+aF6NENIPf/hs54f0sZFUVAMigAAAABJRU5ErkJggg==) } #iframeBody { background: red }";
15 if (window.testRunner)
16 window.testRunner.addUserStyleSheet(styleSheet, true);
21 var iframe = document.createElement("iframe");
22 iframe.src = "resources/inject-stylesheet-iframe-data.html";
23 document.getElementById("main").appendChild(iframe);
28 InspectorTest.evaluateInPage("injectStyleSheet()", init);
32 InspectorTest.selectNodeAndWaitForStylesWithComputed("main", step0);
37 InspectorTest.addResult("Main frame style:");
38 InspectorTest.dumpSelectedElementStyles();
39 InspectorTest.evaluateInPage("loadIframe()");
40 InspectorTest.addConsoleSniffer(step1);
45 InspectorTest.selectNodeAndWaitForStyles("iframeBody", step2);
50 InspectorTest.addResult("iframe style:");
51 InspectorTest.dumpSelectedElementStyles();
52 InspectorTest.completeTest();
58 <body onload="runTest()">
60 Tests that injected user stylesheets are reflected in the Styles pane.