Chromium Code Reviews| 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 function log(message) { | |
|
aandrey
2014/07/28 14:14:43
use InspectorTest.addResult() instead
| |
| 26 InspectorTest.evaluateInPage("console.log('"+ message.replace(/'/g, "\\' ").replace(/\n/g, "\\n") +"');"); | |
| 27 } | |
| 28 | |
| 29 log("Starting test"); | |
| 30 WebInspector.inspectorView.showPanel("sources"); | |
| 31 var pane = WebInspector.panels.sources.sidebarPanes.eventListenerBreakpoints ; | |
| 32 InspectorTest.runDebuggerTestSuite([ | |
| 33 function testCloseBreakpoint(next) | |
| 34 { | |
| 35 log("Setting breakpoint"); | |
| 36 pane._setBreakpoint('instrumentation:close'); | |
| 37 | |
| 38 log("Calling window.close()"); | |
| 39 InspectorTest.waitUntilPaused(paused); | |
| 40 InspectorTest.evaluateInPage("doClose()"); | |
| 41 | |
| 42 function paused(callFrames, reason, breakpointIds, asyncStackTrace, auxData) | |
| 43 { | |
| 44 var stacktrace = InspectorTest.captureStackTraceIntoString(callF rames, asyncStackTrace); | |
|
aandrey
2014/07/28 14:14:43
remove asyncStackTrace argument
| |
| 45 log("Paused in breakpoint"); | |
| 46 // drop external stack references | |
| 47 log(stacktrace.slice(0, stacktrace.indexOf('2)')).trim()); | |
|
aandrey
2014/07/28 14:14:43
you can drop everything except the top call frame
| |
| 48 | |
| 49 pane._removeBreakpoint('instrumentation:close'); | |
| 50 next(); | |
| 51 } | |
| 52 } | |
| 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 |