3 <script src=
"inspector-test.js"></script>
4 <script src=
"console-test.js"></script>
14 InspectorTest
.addSniffer(WebInspector
.Main
.prototype, "inspect", sniffInspect
, true);
16 function sniffInspect(objectId
, hints
)
18 InspectorTest
.addResult("WebInspector.inspect called with: " + objectId
.description
);
19 InspectorTest
.addResult("WebInspector.inspect's hints are: " + JSON
.stringify(Object
.keys(hints
)));
22 function evalAndDump(expression
, next
)
24 InspectorTest
.addResult("\n");
25 InspectorTest
.evaluateInConsole(expression
, dumpCallback
);
26 function dumpCallback(text
)
28 InspectorTest
.addResult(expression
+ " = " + text
);
34 InspectorTest
.runTestSuite([
35 function testRevealElement(next
)
37 InspectorTest
.addSniffer(WebInspector
.Revealer
, "revealPromise", step2
, true);
38 evalAndDump("inspect($('#p1'))");
40 function step2(node
, revealPromise
)
42 if (!(node
instanceof WebInspector
.RemoteObject
))
44 revealPromise
.then(step3
);
49 InspectorTest
.addResult("Selected node id: '" + WebInspector
.panels
.elements
.selectedDOMNode().getAttribute("id") + "'.");
59 <body onload=
"onload()">
61 Tests that inspect() command line api works.