3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/debugger-test.js"></script>
7 function testFunction()
14 var testName
= InspectorTest
.resourceTreeModel
.inspectedPageURL();
15 testName
= testName
.substring(testName
.lastIndexOf('/') + 1);
16 InspectorTest
.startDebuggerTest(step1
);
20 InspectorTest
.showScriptSource(testName
, step2
);
23 function step2(sourceFrame
)
25 testSourceFrame
= sourceFrame
;
26 InspectorTest
.addResult("Main resource was shown.");
27 InspectorTest
.debuggerModel
.addEventListener(WebInspector
.DebuggerModel
.Events
.DebuggerWasDisabled
, step3
, this);
28 InspectorTest
.debuggerModel
.disableDebugger();
33 InspectorTest
.debuggerModel
.removeEventListener(WebInspector
.DebuggerModel
.Events
.DebuggerWasDisabled
, step3
, this);
34 InspectorTest
.addResult("Debugger disabled.");
35 InspectorTest
.setBreakpoint(testSourceFrame
, 8, "", true);
36 InspectorTest
.addResult("Breakpoint added");
37 InspectorTest
.debuggerModel
.addEventListener(WebInspector
.DebuggerModel
.Events
.DebuggerWasEnabled
, step4
, this);
38 InspectorTest
.debuggerModel
.enableDebugger();
43 InspectorTest
.debuggerModel
.removeEventListener(WebInspector
.DebuggerModel
.Events
.DebuggerWasEnabled
, step4
, this);
44 InspectorTest
.addResult("Debugger was enabled");
45 InspectorTest
.runTestFunctionAndWaitUntilPaused(step5
);
50 InspectorTest
.resumeExecution(step6
);
55 InspectorTest
.addResult("Disable debugger again");
56 InspectorTest
.debuggerModel
.addEventListener(WebInspector
.DebuggerModel
.Events
.DebuggerWasDisabled
, step7
, this);
57 InspectorTest
.debuggerModel
.disableDebugger();
62 InspectorTest
.addResult("Debugger disabled");
63 var breakpoint
= WebInspector
.breakpointManager
.findBreakpointOnLine(testSourceFrame
.uiSourceCode(), 8);
65 InspectorTest
.addResult("Breakpoint removed");
66 InspectorTest
.debuggerModel
.addEventListener(WebInspector
.DebuggerModel
.Events
.DebuggerWasEnabled
, step8
, this);
67 InspectorTest
.debuggerModel
.enableDebugger();
72 InspectorTest
.addResult("Debugger enabled");
73 InspectorTest
.addResult("Evaluating test function.");
74 InspectorTest
.evaluateInPage("testFunction()", step9
);
79 InspectorTest
.addResult("function evaluated without a pause on the breakpoint.")
80 InspectorTest
.completeDebuggerTest();
87 <body onload=
"runTest()">
89 Tests that breakpoints are correctly handled while debugger is turned off
</a>