| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> | 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| 5 <script src="../debugger/resources/script1.js"></script> | 5 <script src="../debugger/resources/script1.js"></script> |
| 6 <script> | 6 <script> |
| 7 function throwAnException() | 7 function throwAnException() |
| 8 { | 8 { |
| 9 var i = 0; var j = i + 2; var k = j + i; | 9 var i = 0; var j = i + 2; var k = j + i; |
| 10 | 10 |
| 11 return unknown_var; | 11 return unknown_var; |
| 12 } | 12 } |
| 13 | 13 |
| 14 var test = function() | 14 var test = function() |
| 15 { | 15 { |
| 16 var panel = WebInspector.panels.sources; | 16 var panel = UI.panels.sources; |
| 17 InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.
PauseOnExceptionsState.PauseOnUncaughtExceptions); | 17 InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnEx
ceptionsState.PauseOnUncaughtExceptions); |
| 18 | 18 |
| 19 InspectorTest.runDebuggerTestSuite([ | 19 InspectorTest.runDebuggerTestSuite([ |
| 20 function testRevealAfterPausedOnException(next) | 20 function testRevealAfterPausedOnException(next) |
| 21 { | 21 { |
| 22 InspectorTest.addResult("Showing script1 source..."); | 22 InspectorTest.addResult("Showing script1 source..."); |
| 23 InspectorTest.showScriptSource("script1.js", step2); | 23 InspectorTest.showScriptSource("script1.js", step2); |
| 24 | 24 |
| 25 function step2() | 25 function step2() |
| 26 { | 26 { |
| 27 InspectorTest.addResult("Script source was shown for '" + panel.
visibleView._uiSourceCode.name() + "'."); | 27 InspectorTest.addResult("Script source was shown for '" + panel.
visibleView._uiSourceCode.name() + "'."); |
| 28 InspectorTest.addResult("Throwing exception..."); | 28 InspectorTest.addResult("Throwing exception..."); |
| 29 InspectorTest.evaluateInPage("setTimeout(throwAnException, 0)"); | 29 InspectorTest.evaluateInPage("setTimeout(throwAnException, 0)"); |
| 30 InspectorTest.addSniffer(WebInspector.TabbedEditorContainer.prot
otype, "showFile", step3); | 30 InspectorTest.addSniffer(Sources.TabbedEditorContainer.prototype
, "showFile", step3); |
| 31 } | 31 } |
| 32 | 32 |
| 33 function step3() | 33 function step3() |
| 34 { | 34 { |
| 35 InspectorTest.addResult("Script source was shown for '" + panel.
visibleView._uiSourceCode.name() + "'."); | 35 InspectorTest.addResult("Script source was shown for '" + panel.
visibleView._uiSourceCode.name() + "'."); |
| 36 InspectorTest.addResult("Reloading page..."); | 36 InspectorTest.addResult("Reloading page..."); |
| 37 InspectorTest.reloadPage(step4); | 37 InspectorTest.reloadPage(step4); |
| 38 } | 38 } |
| 39 | 39 |
| 40 function step4() | 40 function step4() |
| 41 { | 41 { |
| 42 InspectorTest.addResult("Showing script1 source..."); | 42 InspectorTest.addResult("Showing script1 source..."); |
| 43 InspectorTest.showScriptSource("script1.js", step5); | 43 InspectorTest.showScriptSource("script1.js", step5); |
| 44 } | 44 } |
| 45 | 45 |
| 46 function step5() | 46 function step5() |
| 47 { | 47 { |
| 48 InspectorTest.addResult("Script source was shown for '" + panel.
visibleView._uiSourceCode.name() + "'."); | 48 InspectorTest.addResult("Script source was shown for '" + panel.
visibleView._uiSourceCode.name() + "'."); |
| 49 InspectorTest.addResult("Throwing exception..."); | 49 InspectorTest.addResult("Throwing exception..."); |
| 50 InspectorTest.evaluateInPage("setTimeout(throwAnException, 0)"); | 50 InspectorTest.evaluateInPage("setTimeout(throwAnException, 0)"); |
| 51 InspectorTest.addSniffer(WebInspector.TabbedEditorContainer.prot
otype, "showFile", step6); | 51 InspectorTest.addSniffer(Sources.TabbedEditorContainer.prototype
, "showFile", step6); |
| 52 } | 52 } |
| 53 | 53 |
| 54 function step6() | 54 function step6() |
| 55 { | 55 { |
| 56 InspectorTest.addResult("Script source was shown for '" + panel.
visibleView._uiSourceCode.name() + "'."); | 56 InspectorTest.addResult("Script source was shown for '" + panel.
visibleView._uiSourceCode.name() + "'."); |
| 57 next(); | 57 next(); |
| 58 } | 58 } |
| 59 }, | 59 }, |
| 60 | 60 |
| 61 function testRevealAfterPrettyPrintWhenPaused(next) | 61 function testRevealAfterPrettyPrintWhenPaused(next) |
| 62 { | 62 { |
| 63 InspectorTest.addResult("Throwing exception..."); | 63 InspectorTest.addResult("Throwing exception..."); |
| 64 InspectorTest.waitUntilPaused(step2); | 64 InspectorTest.waitUntilPaused(step2); |
| 65 function step2() | 65 function step2() |
| 66 { | 66 { |
| 67 InspectorTest.addResult("Showing script1 source..."); | 67 InspectorTest.addResult("Showing script1 source..."); |
| 68 InspectorTest.showScriptSource("script1.js", step3); | 68 InspectorTest.showScriptSource("script1.js", step3); |
| 69 } | 69 } |
| 70 | 70 |
| 71 function step3() | 71 function step3() |
| 72 { | 72 { |
| 73 InspectorTest.addResult("Script source was shown for '" + panel.
visibleView._uiSourceCode.name() + "'."); | 73 InspectorTest.addResult("Script source was shown for '" + panel.
visibleView._uiSourceCode.name() + "'."); |
| 74 InspectorTest.addResult("Formatting..."); | 74 InspectorTest.addResult("Formatting..."); |
| 75 InspectorTest.scriptFormatter().then(function(scriptFormatter) { | 75 InspectorTest.scriptFormatter().then(function(scriptFormatter) { |
| 76 InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorA
ction.prototype, "_updateButton", uiSourceCodeScriptFormatted); | 76 InspectorTest.addSniffer(Sources.ScriptFormatterEditorAction
.prototype, "_updateButton", uiSourceCodeScriptFormatted); |
| 77 scriptFormatter._toggleFormatScriptSource(); | 77 scriptFormatter._toggleFormatScriptSource(); |
| 78 }); | 78 }); |
| 79 } | 79 } |
| 80 | 80 |
| 81 function uiSourceCodeScriptFormatted() | 81 function uiSourceCodeScriptFormatted() |
| 82 { | 82 { |
| 83 InspectorTest.addResult("Script source was shown for '" + panel.
visibleView._uiSourceCode.name() + "'."); | 83 InspectorTest.addResult("Script source was shown for '" + panel.
visibleView._uiSourceCode.name() + "'."); |
| 84 next(); | 84 next(); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 ]); | 87 ]); |
| 88 } | 88 } |
| 89 </script> | 89 </script> |
| 90 </head> | 90 </head> |
| 91 <body onload="runTest()"> | 91 <body onload="runTest()"> |
| 92 <p>Tests that certain user actions in scripts panel reveal execution line.</p> | 92 <p>Tests that certain user actions in scripts panel reveal execution line.</p> |
| 93 </body> | 93 </body> |
| 94 </html> | 94 </html> |
| OLD | NEW |