| 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 | |
| 6 <script> | |
| 7 | |
| 8 function doClose() | |
| 9 { | |
| 10 window.close(); | |
| 11 } | |
| 12 | |
| 13 function onload() | |
| 14 { | |
| 15 if (window.testRunner) { | |
| 16 testRunner.dumpAsText(); | |
| 17 testRunner.waitUntilDone(); | |
| 18 testRunner.showWebInspector(); | |
| 19 } | |
| 20 runTest(); | |
| 21 } | |
| 22 | |
| 23 var test = function() | |
| 24 { | |
| 25 // This is needed because Inspector.addResult() uses output() which places e
lements | |
| 26 // into the <body> which gets disposed along with the window | |
| 27 function log(message) { | |
| 28 InspectorTest.evaluateInPage("console.log(unescape('"+ escape(message) +
"'));"); | |
| 29 } | |
| 30 | |
| 31 log("Starting test"); | |
| 32 var pane = WebInspector.panels.sources.sidebarPanes.eventListenerBreakpoints
; | |
| 33 InspectorTest.startDebuggerTest(testCloseBreakpoint); | |
| 34 | |
| 35 function testCloseBreakpoint(next) | |
| 36 { | |
| 37 log("Setting breakpoint"); | |
| 38 pane._setBreakpoint('instrumentation:close'); | |
| 39 | |
| 40 log("Calling window.close()"); | |
| 41 InspectorTest.waitUntilPaused(paused); | |
| 42 InspectorTest.evaluateInPage("doClose()"); | |
| 43 | |
| 44 function paused(callFrames) | |
| 45 { | |
| 46 log("Paused in breakpoint"); | |
| 47 // get the first stack frame | |
| 48 log(InspectorTest.captureStackTraceIntoString(callFrames).split('\n'
)[1].trim()); | |
| 49 | |
| 50 pane._removeBreakpoint('instrumentation:close'); | |
| 51 InspectorTest.completeDebuggerTest(); | |
| 52 // After this point execution will resume and the window will close | |
| 53 } | |
| 54 } | |
| 55 } | |
| 56 </script> | |
| 57 </head> | |
| 58 <body onload="onload()"> | |
| 59 <p>Tests the window close breakpoint. | |
| 60 </p> | |
| 61 </body> | |
| 62 </html> | |
| OLD | NEW |