| <html> |
| <head> |
| <script src="../../http/tests/inspector/inspector-test.js"></script> |
| <script src="../../http/tests/inspector/extensions-test.js"></script> |
| <script type="text/javascript"> |
| |
| window.whereAmI = "main world"; |
| |
| testRunner.setIsolatedWorldSecurityOrigin(632, "file:///"); |
| testRunner.evaluateScriptInIsolatedWorld(632, "window.whereAmI = 'brave new world'"); |
| |
| function extension_testEvalInMainWorldImplicit(nextTest) |
| { |
| webInspector.inspectedWindow.eval("whereAmI", callbackAndNextTest(extension_onEval, nextTest)); |
| } |
| |
| function extension_testEvalInMainWorldExplicit(nextTest) |
| { |
| webInspector.inspectedWindow.eval("whereAmI", { useContentScriptContext: false }, callbackAndNextTest(extension_onEval, nextTest)); |
| } |
| |
| function extension_testEvalInContentScriptContext(nextTest) |
| { |
| webInspector.inspectedWindow.eval("whereAmI", { useContentScriptContext: true }, 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> |