| <html> |
| <head> |
| <script src="../../http/tests/inspector/inspector-test.js"></script> |
| <script> |
| |
| function test() |
| { |
| function dumpState(next) |
| { |
| PageAgent.getScriptExecutionStatus(statusCallback); |
| function statusCallback(error, status) |
| { |
| if (error) { |
| InspectorTest.addResult("Error: " + JSON.stringify(error)); |
| return; |
| } |
| |
| InspectorTest.addResult("Script execution status: " + status); |
| next(); |
| } |
| } |
| |
| function setJSDisabled(disabled, next) |
| { |
| PageAgent.setScriptExecutionDisabled(disabled, next); |
| } |
| |
| InspectorTest.runTestSuite([ |
| function init(next) |
| { |
| PageAgent.enable(); |
| dumpState(next); |
| }, |
| |
| function checkDisabled(next) |
| { |
| setJSDisabled(true, dumpState.bind(null, next)); |
| }, |
| |
| function checkRestored(next) |
| { |
| setJSDisabled(false, dumpState.bind(null, next)); |
| } |
| ]); |
| } |
| </script> |
| </head> |
| |
| <body onload="runTest()"> |
| <p> |
| Tests that inspector effectively disables script execution in the inspected page. |
| </p> |
| </body> |
| </html> |