| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script> | |
| 4 document.writeln("<script>\nfunction f1() {\n window.foo1 = true;\n}\nf1();
\n <" + "/script>"); | |
| 5 </script> | |
| 6 | |
| 7 <script> | |
| 8 console.assert(window.foo1, "FAIL: foo1"); | |
| 9 </script> | |
| 10 | |
| 11 <script> | |
| 12 function global1() | |
| 13 { | |
| 14 debugger; | |
| 15 document.writeln("<script>\nfunction f2() {\n window.foo2 = true;\n}\nf2();
\n <" + "/script>"); | |
| 16 } | |
| 17 var x = global1(); | |
| 18 </script> | |
| 19 | |
| 20 <script> | |
| 21 console.assert(window.foo2, "FAIL: foo2"); | |
| 22 </script> | |
| 23 | |
| 24 <script src="../../../http/tests/inspector/inspector-test.js"></script> | |
| 25 <script src="../../../http/tests/inspector/debugger-test.js"></script> | |
| 26 | |
| 27 <script> | |
| 28 | |
| 29 function test() | |
| 30 { | |
| 31 var numberOfStepOut = 5; | |
| 32 | |
| 33 InspectorTest.startDebuggerTest(step1, true); | |
| 34 | |
| 35 function step1() | |
| 36 { | |
| 37 InspectorTest.showScriptSource("debugger-step-out-document-write.html",
step2); | |
| 38 } | |
| 39 | |
| 40 function step2(sourceFrame) | |
| 41 { | |
| 42 InspectorTest.addResult("Script source was shown."); | |
| 43 InspectorTest.setBreakpoint(sourceFrame, 3, "", true); | |
| 44 InspectorTest.waitUntilPaused(step3); | |
| 45 InspectorTest.reloadPage(completeTest); | |
| 46 } | |
| 47 | |
| 48 function step3() | |
| 49 { | |
| 50 var actions = ["Print"]; // First pause on breakpoint. | |
| 51 for (var i = 0; i < numberOfStepOut; ++i) | |
| 52 actions.push("StepOut", "Print"); | |
| 53 actions.push("Resume"); | |
| 54 InspectorTest.waitUntilPausedAndPerformSteppingActions(actions); | |
| 55 } | |
| 56 | |
| 57 function completeTest() | |
| 58 { | |
| 59 InspectorTest.completeDebuggerTest(); | |
| 60 } | |
| 61 } | |
| 62 | |
| 63 </script> | |
| 64 </head> | |
| 65 | |
| 66 <body onload="runTest()"> | |
| 67 <p> | |
| 68 Tests that debugger StepOut will skip inlined scripts created by document.write(
). | |
| 69 </p> | |
| 70 </body> | |
| 71 </html> | |
| OLD | NEW |