Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / debugger / debugger-disable-enable.html
blob5d8c9a333f04d62b758539a67fc7ed6fe8156328
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script>
5 <script>
7 function testFunction()
9 return 0;
12 var test = function()
14 var testName = InspectorTest.resourceTreeModel.inspectedPageURL();
15 testName = testName.substring(testName.lastIndexOf('/') + 1);
16 InspectorTest.startDebuggerTest(step1);
18 function step1()
20 InspectorTest.showScriptSource(testName, step2);
23 function step2(sourceFrame)
25 InspectorTest.addResult("Main resource was shown.");
26 InspectorTest.setBreakpoint(sourceFrame, 8, "", true);
27 InspectorTest.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasDisabled, step3, this);
28 InspectorTest.debuggerModel.disableDebugger();
31 function step3()
33 InspectorTest.addResult("Debugger disabled.");
34 InspectorTest.addResult("Evaluating test function.");
35 InspectorTest.evaluateInPage("testFunction()", step4);
38 function step4()
40 InspectorTest.addResult("function evaluated without a pause on the breakpoint.");
41 InspectorTest.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasEnabled, step5, this);
42 InspectorTest.debuggerModel.enableDebugger();
45 function step5()
47 InspectorTest.addResult("Debugger was enabled");
48 InspectorTest.runTestFunctionAndWaitUntilPaused(step6);
51 function step6()
53 InspectorTest.completeDebuggerTest();
57 </script>
58 </head>
60 <body onload="runTest()">
61 <p>
62 Tests that breakpoints are successfully restored after debugger disabling.</a>
63 </p>
64 </body>
65 </html>