3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/debugger-test.js"></script>
5 <script src=
"../debugger/resources/script1.js"></script>
7 function throwAnException()
9 var i
= 0; var j
= i
+ 2; var k
= j
+ i
;
16 var panel
= WebInspector
.panels
.sources
;
17 InspectorTest
.DebuggerAgent
.setPauseOnExceptions(WebInspector
.DebuggerModel
.PauseOnExceptionsState
.PauseOnUncaughtExceptions
);
19 InspectorTest
.runDebuggerTestSuite([
20 function testRevealAfterPausedOnException(next
)
22 InspectorTest
.addResult("Showing script1 source...");
23 InspectorTest
.showScriptSource("script1.js", step2
);
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
.prototype, "showFile", step3
);
35 InspectorTest
.addResult("Script source was shown for '" + panel
.visibleView
._uiSourceCode
.name() + "'.");
36 InspectorTest
.addResult("Reloading page...");
37 InspectorTest
.reloadPage(step4
);
42 InspectorTest
.addResult("Showing script1 source...");
43 InspectorTest
.showScriptSource("script1.js", step5
);
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
.prototype, "showFile", step6
);
56 InspectorTest
.addResult("Script source was shown for '" + panel
.visibleView
._uiSourceCode
.name() + "'.");
61 function testRevealAfterPrettyPrintWhenPaused(next
)
63 InspectorTest
.addResult("Throwing exception...");
64 InspectorTest
.waitUntilPaused(step2
);
67 InspectorTest
.addResult("Showing script1 source...");
68 InspectorTest
.showScriptSource("script1.js", step3
);
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
.ScriptFormatterEditorAction
.prototype, "_updateButton", uiSourceCodeScriptFormatted
);
77 scriptFormatter
._toggleFormatScriptSource();
81 function uiSourceCodeScriptFormatted()
83 InspectorTest
.addResult("Script source was shown for '" + panel
.visibleView
._uiSourceCode
.name() + "'.");
91 <body onload=
"runTest()">
92 <p>Tests that certain user actions in scripts panel reveal execution line.
</p>