Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 if (quiet !== undefined) | 5 if (quiet !== undefined) |
| 6 InspectorTest._quiet = quiet; | 6 InspectorTest._quiet = quiet; |
| 7 WebInspector.inspectorView.showPanel("sources"); | 7 WebInspector.inspectorView.showPanel("sources"); |
| 8 | 8 |
|
yurys
2014/06/06 08:59:58
Let's add an assert that WebInspector.debuggerMode
loislo
2014/06/06 12:41:12
Done.
| |
| 9 if (WebInspector.debuggerModel.debuggerEnabled()) | 9 InspectorTest.addSniffer(WebInspector.debuggerModel, "_pausedScript", Inspec torTest._pausedScript, true); |
| 10 startTest(); | 10 InspectorTest.addSniffer(WebInspector.debuggerModel, "_resumedScript", Inspe ctorTest._resumedScript, true); |
| 11 else { | 11 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 }; | 12 }; |
| 48 | 13 |
| 49 InspectorTest.completeDebuggerTest = function() | 14 InspectorTest.completeDebuggerTest = function() |
| 50 { | 15 { |
| 51 InspectorTest.finishDebuggerTest(InspectorTest.completeTest.bind(InspectorTe st)); | 16 WebInspector.debuggerModel.setBreakpointsActive(true); |
| 17 InspectorTest.resumeExecution(InspectorTest.completeTest.bind(InspectorTest) ); | |
| 52 }; | 18 }; |
| 53 | 19 |
| 54 InspectorTest.runDebuggerTestSuite = function(testSuite) | 20 InspectorTest.runDebuggerTestSuite = function(testSuite) |
| 55 { | 21 { |
| 56 var testSuiteTests = testSuite.slice(); | 22 var testSuiteTests = testSuite.slice(); |
| 57 | 23 |
| 58 function runner() | 24 function runner() |
| 59 { | 25 { |
| 60 if (!testSuiteTests.length) { | 26 if (!testSuiteTests.length) { |
| 61 InspectorTest.completeDebuggerTest(); | 27 InspectorTest.completeDebuggerTest(); |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 441 InspectorTest.scriptFormatter = function() | 407 InspectorTest.scriptFormatter = function() |
| 442 { | 408 { |
| 443 var editorActions = WebInspector.moduleManager.instances(WebInspector.Source sView.EditorAction); | 409 var editorActions = WebInspector.moduleManager.instances(WebInspector.Source sView.EditorAction); |
| 444 for (var i = 0; i < editorActions.length; ++i) { | 410 for (var i = 0; i < editorActions.length; ++i) { |
| 445 if (editorActions[i] instanceof WebInspector.ScriptFormatterEditorAction ) | 411 if (editorActions[i] instanceof WebInspector.ScriptFormatterEditorAction ) |
| 446 return editorActions[i]; | 412 return editorActions[i]; |
| 447 } | 413 } |
| 448 }; | 414 }; |
| 449 | 415 |
| 450 }; | 416 }; |
| OLD | NEW |