Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / sources / debugger / disable-script.html
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script>
5
6 function test()
7 {
8     function dumpState(next)
9     {
10         PageAgent.getScriptExecutionStatus(statusCallback);
11         function statusCallback(error, status)
12         {
13             if (error) {
14                 InspectorTest.addResult("Error: " + JSON.stringify(error));
15                 return;
16             }
17
18             InspectorTest.addResult("Script execution status: " + status);
19             next();
20         }
21     }
22
23     function setJSDisabled(disabled, next)
24     {
25         PageAgent.setScriptExecutionDisabled(disabled, next);
26     }
27
28     InspectorTest.runTestSuite([
29         function init(next)
30         {
31             PageAgent.enable();
32             dumpState(next);
33         },
34
35         function checkDisabled(next)
36         {
37             setJSDisabled(true, dumpState.bind(null, next));
38         },
39
40         function checkRestored(next)
41         {
42             setJSDisabled(false, dumpState.bind(null, next));
43         }
44     ]);
45 }
46 </script>
47 </head>
48
49 <body onload="runTest()">
50 <p>
51 Tests that inspector effectively disables script execution in the inspected page.
52 </p>
53 </body>
54 </html>