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

Side by Side Diff: LayoutTests/http/tests/inspector/debugger-test.js

Issue 316403002: DevTools: cleanup debugger tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaselined 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
1 var initialize_DebuggerTest = function() { 1 var initialize_DebuggerTest = function() {
2 2
3 InspectorTest.startDebuggerTest = function(callback, quiet) 3 InspectorTest.startDebuggerTest = function(callback, quiet)
4 { 4 {
5 console.assert(WebInspector.debuggerModel.debuggerEnabled(), "Debugger has t o be enabled");
5 if (quiet !== undefined) 6 if (quiet !== undefined)
6 InspectorTest._quiet = quiet; 7 InspectorTest._quiet = quiet;
7 WebInspector.inspectorView.showPanel("sources"); 8 WebInspector.inspectorView.showPanel("sources");
8 9
9 if (WebInspector.debuggerModel.debuggerEnabled()) 10 InspectorTest.addSniffer(WebInspector.debuggerModel, "_pausedScript", Inspec torTest._pausedScript, true);
10 startTest(); 11 InspectorTest.addSniffer(WebInspector.debuggerModel, "_resumedScript", Inspe ctorTest._resumedScript, true);
11 else { 12 InspectorTest.safeWrap(callback)();
12 InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasEnable d", startTest);
13 WebInspector.debuggerModel.enableDebugger();
14 }
15
16 function startTest()
17 {
18 InspectorTest.addResult("Debugger was enabled.");
19 InspectorTest.addSniffer(WebInspector.debuggerModel, "_pausedScript", In spectorTest._pausedScript, true);
20 InspectorTest.addSniffer(WebInspector.debuggerModel, "_resumedScript", I nspectorTest._resumedScript, true);
21 InspectorTest.safeWrap(callback)();
22 }
23 };
24
25 InspectorTest.finishDebuggerTest = function(callback)
26 {
27 var sourcesPanel = WebInspector.panels.sources;
28
29 WebInspector.debuggerModel.setBreakpointsActive(true);
30 InspectorTest.resumeExecution(disableDebugger);
31
32 function disableDebugger()
33 {
34 if (!WebInspector.debuggerModel.debuggerEnabled())
35 completeTest();
36 else {
37 InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasDi sabled", debuggerDisabled);
38 WebInspector.debuggerModel.disableDebugger();
39 }
40 }
41
42 function debuggerDisabled()
43 {
44 InspectorTest.addResult("Debugger was disabled.");
45 callback();
46 }
47 }; 13 };
48 14
49 InspectorTest.completeDebuggerTest = function() 15 InspectorTest.completeDebuggerTest = function()
50 { 16 {
51 InspectorTest.finishDebuggerTest(InspectorTest.completeTest.bind(InspectorTe st)); 17 WebInspector.debuggerModel.setBreakpointsActive(true);
18 InspectorTest.resumeExecution(InspectorTest.completeTest.bind(InspectorTest) );
52 }; 19 };
53 20
54 InspectorTest.runDebuggerTestSuite = function(testSuite) 21 InspectorTest.runDebuggerTestSuite = function(testSuite)
55 { 22 {
56 var testSuiteTests = testSuite.slice(); 23 var testSuiteTests = testSuite.slice();
57 24
58 function runner() 25 function runner()
59 { 26 {
60 if (!testSuiteTests.length) { 27 if (!testSuiteTests.length) {
61 InspectorTest.completeDebuggerTest(); 28 InspectorTest.completeDebuggerTest();
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 InspectorTest.scriptFormatter = function() 408 InspectorTest.scriptFormatter = function()
442 { 409 {
443 var editorActions = WebInspector.moduleManager.instances(WebInspector.Source sView.EditorAction); 410 var editorActions = WebInspector.moduleManager.instances(WebInspector.Source sView.EditorAction);
444 for (var i = 0; i < editorActions.length; ++i) { 411 for (var i = 0; i < editorActions.length; ++i) {
445 if (editorActions[i] instanceof WebInspector.ScriptFormatterEditorAction ) 412 if (editorActions[i] instanceof WebInspector.ScriptFormatterEditorAction )
446 return editorActions[i]; 413 return editorActions[i];
447 } 414 }
448 }; 415 };
449 416
450 }; 417 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698