1 <style>code{background-color: #ffc;}
</style>
2 <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>
5 <li><p>open this page with Web Inspector
6 <li><p>switch to the Scripts panel, enabling debug if required
7 <li><p>the available scripts in the select element should be:
11 <li>bp-in-named-eval-after-reload.html
13 <li><p>In
<code>(program) f1.js
</code>, set a breakpoint on the first
14 executable line of the function
<code>f1()
</code>, the invocation of
<code>doNothing()
</code>.
15 <li><p>In
<code>(program) f2.js
</code>, set a breakpoint on the first
16 executable line of the function
<code>f2()
</code>, the invocation of
<code>doNothing()
</code>.
17 <li><p>click this button:
<input id=button type=button
value=
"click me">
18 <li><p>debugger should stop in the
<code>f1()
</code> function.
19 <li><p>resume the debugger
20 <li><p>debugger should stop in the
<code>f2()
</code> function (the function in
<code>(program) f2.js
</code>)
21 <li><p>resume the debugger
22 <li><p>switch to the web page, reload the web page, switch back to web inspector
23 <li><p>in the breakpoints sidebar panel, click on the two breakpoints listed
24 and the source for those functions should be shown in the source panel, and
25 the previous breakpoint markers should be visible
26 <li><p>click the
"click me" button above, again
27 <li><p>debugger should stop in the
<code>f1()
</code> function.
28 <li><p>resume the debugger
29 <li><p>debugger should stop in the
<code>f2()
</code> function.
30 <li><p>resume the debugger
33 <p>Note that without the fix in
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=31375">Bug
31375</a>,
34 the breakpoints won't work after reloading the page.
38 function doNothing() { /* allows multi-line functions, easier to debug */ };
43 " console.log(new Date() + ': f1() called');",
51 " console.log(new Date() + ': f2() called');",
55 var button
= document
.getElementById("button");
57 button
.addEventListener("click", clickHandler
, false);
59 function clickHandler() {