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