3 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../http/tests/inspector/extensions-test.js"></script>
5 <script src=
"../audits/audits-test.js"></script>
6 <script src=
"extensions-audits-tests.js"></script>
8 <script type=
"text/javascript">
10 window
.whereAmI
= "main world";
12 testRunner
.setIsolatedWorldSecurityOrigin(632, "file:///");
13 testRunner
.evaluateScriptInIsolatedWorld(632, "window.whereAmI = 'brave new world'");
15 function extension_testAudits(nextTest
)
17 var pendingOutput
= [];
19 function onStartAuditCategory(results
)
21 pendingOutput
.push("category.onAuditStarted fired");
22 var node
= results
.createResult("Test Formatters");
23 node
.addChild(results
.createObject("({whereAmI: window.whereAmI})", "main world object"));
24 node
.addChild(results
.createNode("document.getElementById('test-element')"));
26 node
.addChild(results
.createObject("({whereAmI: window.whereAmI})", "content script object", { useContentScriptContext
: true }));
27 node
.addChild(results
.createNode("document.getElementById('test-element')", { useContentScriptContext
: true }));
29 results
.addResult("Rule with details subtree (1)", "", results
.Severity
.Warning
, node
);
32 var category
= webInspector
.audits
.addCategory("Extension audits", 20);
33 category
.onAuditStarted
.addListener(onStartAuditCategory
);
37 pendingOutput
.sort().forEach(output
);
40 webInspector
.inspectedWindow
.eval("", function() {
41 extension_runAudits(auditsDone
);
47 <body onload=
"runTest()">
48 <p>Tests audit formatters performing evals on content scripts in WebInspector Extensions API
</p>
49 <span id=
"test-element"><b></b></span>