Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Side by Side Diff: LayoutTests/inspector/sources/debugger/debugger-disable-add-breakpoint.html

Issue 323503002: Devtools: Support disabling and enabling of debugger in TargetBreakpoints (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Test that adds/removes breakpoint while debugger is turned off Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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>
6
7 function testFunction()
8 {
9 return 0;
10 }
11
12 var test = function()
13 {
14 var testName = WebInspector.resourceTreeModel.inspectedPageURL();
15 testName = testName.substring(testName.lastIndexOf('/') + 1);
16 setTimeout(InspectorTest.completeDebuggerTest, 1000);
loislo 2014/06/06 18:00:21 Please remove this. Test harness already have a wa
sergeyv 2014/06/09 09:08:02 Done.
17 InspectorTest.startDebuggerTest(step1);
18 var testSourceFrame;
19 function step1()
20 {
21 InspectorTest.showScriptSource(testName, step2);
22 }
23
24 function step2(sourceFrame)
25 {
26 testSourceFrame = sourceFrame;
27 InspectorTest.addResult("Main resource was shown.");
28 InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasDisabl ed", step3);
29 WebInspector.debuggerModel.disableDebugger();
30 }
31
32 function step3()
33 {
34 InspectorTest.addResult("Debugger disabled.");
35 InspectorTest.setBreakpoint(testSourceFrame, 8, "", true);
36 InspectorTest.addResult("Breakpoint added");
37 InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasEnable d", step4);
38 WebInspector.debuggerModel.enableDebugger();
39 }
40
41 function step4()
42 {
43 InspectorTest.addResult("Debugger was enabled");
44 InspectorTest.runTestFunctionAndWaitUntilPaused(step5);
45 }
46
47 function step5()
48 {
49 InspectorTest.resumeExecution(step6);
50 }
51
52 function step6()
53 {
54 InspectorTest.addResult("Disable debugger again");
55 InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasDisabl ed", step7);
56 WebInspector.debuggerModel.disableDebugger();
57 }
58
59 function step7()
60 {
61 InspectorTest.addResult("Debugger disabled");
62 var breakpoint = WebInspector.breakpointManager.findBreakpointOnLine(tes tSourceFrame.uiSourceCode(), 8);
63 breakpoint.remove();
64 InspectorTest.addResult("Breakpoint removed");
65 InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasEnable d", step8);
66 WebInspector.debuggerModel.enableDebugger();
67 }
68
69 function step8()
70 {
71 InspectorTest.addResult("Debugger enabled");
72 InspectorTest.addResult("Evaluating test function.");
73 InspectorTest.evaluateInConsole("testFunction()", step9);
74 }
75
76 function step9()
77 {
78 InspectorTest.addResult("function evaluated without a pause on the break point.")
79 InspectorTest.completeDebuggerTest();
80 }
81 };
82
83 </script>
84 </head>
85
86 <body onload="runTest()">
87 <p>
88 Tests that breakpoints are correctly handled while debugger is turned off</a>
89 </p>
90 </body>
91 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698