| <html> |
| <head> |
| <script src="../http/tests/inspector/inspector-test2.js"></script> |
| <script src="extensions-test.js"></script> |
| <script type="text/javascript"> |
| |
| window.inspectedValue = { str: "foo", num: 42 }; |
| |
| function extension_testEvalOk(nextTest) |
| { |
| webInspector.inspectedWindow.eval("inspectedValue", callbackAndNextTest(extension_onEval, nextTest)); |
| } |
| |
| function extension_testEvalFailed(nextTest) |
| { |
| webInspector.inspectedWindow.eval("document.body", callbackAndNextTest(extension_onEval, nextTest)); |
| } |
| |
| function extension_testEvalDefinesGlobalSymbols(nextTest) |
| { |
| webInspector.inspectedWindow.eval("function extensionFunc() {}"); |
| webInspector.inspectedWindow.eval("extensionVar = 42;"); |
| webInspector.inspectedWindow.eval("({ func: typeof window.extensionFunc, variable: window.extensionVar })", callbackAndNextTest(extension_onEval, nextTest)); |
| } |
| |
| function extension_testEvalStatement(nextTest) |
| { |
| webInspector.inspectedWindow.eval("var x = 3; while (--x); x", callbackAndNextTest(extension_onEval, nextTest)); |
| } |
| |
| function extension_testEvalUndefined(nextTest) |
| { |
| webInspector.inspectedWindow.eval("undefined", callbackAndNextTest(extension_onEval, nextTest)); |
| } |
| |
| function extension_testEvalConsoleAPI(nextTest) |
| { |
| webInspector.inspectedWindow.eval("typeof inspect", callbackAndNextTest(extension_onEval, nextTest)); |
| } |
| |
| function extension_onEval(value, isException) |
| { |
| output("Evaluate: " + JSON.stringify(value) + " (exception: " + isException + ")"); |
| } |
| |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <p>Tests WebInspector extension API</p> |
| </body> |
| </html> |