diff options
Diffstat (limited to 'WebCore/manual-tests/inspector')
4 files changed, 241 insertions, 0 deletions
diff --git a/WebCore/manual-tests/inspector/bp-in-named-eval-after-reload.html b/WebCore/manual-tests/inspector/bp-in-named-eval-after-reload.html new file mode 100644 index 0000000..4612cd6 --- /dev/null +++ b/WebCore/manual-tests/inspector/bp-in-named-eval-after-reload.html @@ -0,0 +1,65 @@ +<style>code{background-color: #ffc;}</style> +<p><b>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=31375">Bug 31375</a> - Web Inspector: breakpoints in named evals are not restored after a reload</b> + +<ul> +<li><p>open this page with Web Inspector +<li><p>switch to the Scripts panel, enabling debug if required +<li><p>the available scripts in the select element should be: +<ul> +<li>(program): f1.js +<li>(program): f2.js +<li>bp-in-named-eval-after-reload.html +</ul> +<li><p>In <code>(program) f1.js</code>, set a breakpoint on the first +executable line of the function <code>f1()</code>, the invocation of <code>doNothing()</code>. +<li><p>In <code>(program) f2.js</code>, set a breakpoint on the first +executable line of the function <code>f2()</code>, the invocation of <code>doNothing()</code>. +<li><p>click this button: <input id=button type=button value="click me"> +<li><p>debugger should stop in the <code>f1()</code> function. +<li><p>resume the debugger +<li><p>debugger should stop in the <code>f2()</code> function (the function in <code>(program) f2.js</code>) +<li><p>resume the debugger +<li><p>switch to the web page, reload the web page, switch back to web inspector +<li><p>in the breakpoints sidebar panel, click on the two breakpoints listed +and the source for those functions should be shown in the source panel, and +the previous breakpoint markers should be visible +<li><p>click the "click me" button above, again +<li><p>debugger should stop in the <code>f1()</code> function. +<li><p>resume the debugger +<li><p>debugger should stop in the <code>f2()</code> function. +<li><p>resume the debugger +</ul> + +<p>Note that without the fix in <a href="https://bugs.webkit.org/show_bug.cgi?id=31375">Bug 31375</a>, +the breakpoints won't work after reloading the page. + +<script> + +function doNothing() { /* allows multi-line functions, easier to debug */ }; + +eval([ + "function f1() {", + " doNothing();", + " console.log(new Date() + ': f1() called');", + "}", + "//@sourceURL=f1.js" +].join("\n")); + +f2 = Function([ + "", + " doNothing();", + " console.log(new Date() + ': f2() called');", + "//@sourceURL=f2.js" +].join("\n")); + +var button = document.getElementById("button"); + +button.addEventListener("click", clickHandler, false); + +function clickHandler() { + f1(); + f2(); +} + +</script> +<!-- End --> diff --git a/WebCore/manual-tests/inspector/debugger-shortcuts-with-console-opened.html b/WebCore/manual-tests/inspector/debugger-shortcuts-with-console-opened.html new file mode 100644 index 0000000..df089d5 --- /dev/null +++ b/WebCore/manual-tests/inspector/debugger-shortcuts-with-console-opened.html @@ -0,0 +1,16 @@ +<script> +function testFunction() +{ + showAlert(); +} + +function showAlert() +{ + alert("Test completed."); +} +</script> +<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=31252">Bug 31252: Web Inspector: Debugger shortcuts (F8, F10, F11) have no effect if the Console view is open</a>.</p> +<p>To test, open the Inspector and start a debugging session. Open the Console view (press Esc or click the "Show console" button in the status bar) and make sure it is focused (the cursor is blinking in the text prompt.) +Set a breakpoint inside testFunction() (on the showAlert() call) and press F8. Now click the Test button in the page. The execution should stop on an HTML line containing <b>onclick="testFunction()"</b>. Press F8. The execution should stop on the breakpoint. +Press F11, F10, F11 sequentially. You should see the "Test completed." alert dialog ONLY after the last keypress.</p> +<button onclick="testFunction()">Test</button><br><br> diff --git a/WebCore/manual-tests/inspector/hidden-evals.html b/WebCore/manual-tests/inspector/hidden-evals.html new file mode 100644 index 0000000..c507bcd --- /dev/null +++ b/WebCore/manual-tests/inspector/hidden-evals.html @@ -0,0 +1,118 @@ + +<p><b>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=30212">Bug 30212</a> - Each JS execution in console adds extra item into "scripts" combo</b> + +<p>The following manual test creates functions via <tt>eval()</tt> and the +<tt>Function()</tt> constructor, some functions are named using the +<code>//@sourceURL=</code> directive, some aren't. Some contain +<tt>debugger</tt> commands, some don't. + +<p>The functions named <tt>f_named_X</tt> are 'named' via the +<code>//@sourceURL=</code> directive, the ones named <tt>f_unnamed_X</tt> +are not. The 'named' functions should show up in the Scripts select element used +to select a resource/script to view, the 'unnamed' ones should not. + +<ul> +<li><p>open this page with Web Inspector +<li><p>switch to the Scripts panel, enabling debug if required +<li><p>the available scripts in the select element should be: +<ul> +<li>(program): f_named_1.eval +<li>(program): f_named_2.eval +<li>(program): f_named_3.eval +<li>hidden-evals.html +</ul> +<li><p>click this button: <input id=button type=button value="click me"> +<li><p>debugger should stop in the <code>clickHandler</code> function +<li><p>at this point, start stepping <b>into</b> the code +<li><p>you should be able to step into functions <code>f_unnamed_1()</code> +and <code>f_unnamed_2()</code>. There are no resource/scripts in the +select element that contain these functions, until you actually are paused +in them. At that point, entries for these functions will be in the select element, +named: "(program)". After pausing in both functions, there will be two "(program)" +entries. +<li><p>you should be able to use the next/prev buttons (to the left of the select element) +to switch to other resources/scripts that have been opened, including the ones +containing these functions +<li><p>you should be able to click on the functions that exist in the 'hidden' +resources from the Call Stack, and be shown the source; click around the +stack trace entries to verify +<li><p>rather than stepping into the <code>f_named_3()</code> call, press the +resume button +<li><p>the debugger should stop in <code>f_named_3()</code> because of the +<code>debugger</code> command +<li><p>rather than stepping into the <code>f_unnamed_3()</code> call, press the +resume button +<li><p>the debugger should stop in <code>f_unnamed_3()</code> because of the +<code>debugger</code> command. At this point, a third "(program)" entry for +this function is added to the select element. +</ul> + +<script> + +function doNothing() { /* allows multi-line functions, easier to debug */ }; + +eval([ + "function f_named_1() {", + " doNothing();", + " return 'named_1';", + "}", + "//@sourceURL=f_named_1.eval" +].join("\n")); + +eval([ + "function f_unnamed_1() {", + " doNothing();", + " return 'unnamed_1';", + "}" +].join("\n")); + +f_named_2 = Function([ + "", + " doNothing();", + " return 'named_2';", + "//@sourceURL=f_named_2.eval" +].join("\n")); + +f_unnamed_2 = Function([ + "", + " doNothing();", + " return 'unnamed_2';" +].join("\n")); + +f_named_3 = Function([ + "", + " debugger;", + " doNothing();", + " return 'named_3';", + "//@sourceURL=f_named_3.eval" +].join("\n")); + +f_unnamed_3 = Function([ + "", + " debugger;", + " doNothing();", + " return 'unnamed_3';" +].join("\n")); + +var button = document.getElementById("button"); + +button.addEventListener("click", clickHandler, false); + +function clickHandler() { + debugger; + f_named_1(); + f_unnamed_1(); + f_named_2(); + f_unnamed_2(); + + // press "resume" at this point + console.log("press resume before calling f_named_3()"); + f_named_3(); + + // press "resume" at this point + console.log("press resume before calling f_unnamed_3()"); + f_unnamed_3(); +} + +</script> +<!-- End --> diff --git a/WebCore/manual-tests/inspector/remember-last-script.html b/WebCore/manual-tests/inspector/remember-last-script.html new file mode 100644 index 0000000..52e7f02 --- /dev/null +++ b/WebCore/manual-tests/inspector/remember-last-script.html @@ -0,0 +1,42 @@ +<style>code{background-color: #ffc;}</style> +<p><b>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=27552">Bug 27552</a> - remember last script displayed in Scripts panel</b> + +<ul> +<li><p>open this page with Web Inspector, switch to the <b>Scripts</b> panel, enabling debug if required +<li><p>the available scripts in the select element should be: + <ul> + <li><b>(program): f1.js</b> + <li><b>remember-last-script.html</b> + </ul> +<li><p>select <b>(program): f1.js</b> so the source is available +<li><p>switch to the <b>Resources</b> panel +<li><p>close Web Inspector +<li><p>Repeat the following several times. Each time, <b>(program): f1.js</b> +should be the selected script: + <ul> + <li>open Web Inspector, switch to the <b>Scripts</b> panel, then close Web Inspector + </ul> +<li><p>open Web Inspector, switch to the <b>Scripts</b> panel +<li><p>select <b>remember-last-script.html</b> so the source is available +<li><p>Repeat the following several times. Each time, <b>remember-last-script.html</b> +should be the selected script: + <ul> + <li>open Web Inspector, switch to the <b>Scripts</b> panel, then close Web Inspector + </ul> +</ul> + +<script> + +f1 = Function([ + "", + " doNothing();", + "//@sourceURL=f1.js" +].join("\n")); + +function doNothing() { /* allows multi-line functions, easier to debug */ }; + +doNothing(); +f1(); + +</script> +<!-- End --> |