Index: LayoutTests/inspector-enabled/sources/debugger/script-window-close-breakpoint.html |
diff --git a/LayoutTests/inspector-enabled/sources/debugger/script-window-close-breakpoint.html b/LayoutTests/inspector-enabled/sources/debugger/script-window-close-breakpoint.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6c36f2fca212c872824db2c7eeecd2258268eea0 |
--- /dev/null |
+++ b/LayoutTests/inspector-enabled/sources/debugger/script-window-close-breakpoint.html |
@@ -0,0 +1,62 @@ |
+<html> |
+<head> |
+<script src="../../../http/tests/inspector/inspector-test.js"></script> |
+<script src="../../../http/tests/inspector/debugger-test.js"></script> |
+ |
+<script> |
+ |
+function doClose() |
+{ |
+ window.close(); |
+} |
+ |
+function onload() |
+{ |
+ if (window.testRunner) { |
+ testRunner.dumpAsText(); |
+ testRunner.waitUntilDone(); |
+ testRunner.showWebInspector(); |
+ } |
+ runTest(); |
+} |
+ |
+var test = function() |
+{ |
+ function log(message) { |
aandrey
2014/07/28 14:14:43
use InspectorTest.addResult() instead
|
+ InspectorTest.evaluateInPage("console.log('"+ message.replace(/'/g, "\\'").replace(/\n/g, "\\n") +"');"); |
+ } |
+ |
+ log("Starting test"); |
+ WebInspector.inspectorView.showPanel("sources"); |
+ var pane = WebInspector.panels.sources.sidebarPanes.eventListenerBreakpoints; |
+ InspectorTest.runDebuggerTestSuite([ |
+ function testCloseBreakpoint(next) |
+ { |
+ log("Setting breakpoint"); |
+ pane._setBreakpoint('instrumentation:close'); |
+ |
+ log("Calling window.close()"); |
+ InspectorTest.waitUntilPaused(paused); |
+ InspectorTest.evaluateInPage("doClose()"); |
+ |
+ function paused(callFrames, reason, breakpointIds, asyncStackTrace, auxData) |
+ { |
+ var stacktrace = InspectorTest.captureStackTraceIntoString(callFrames, asyncStackTrace); |
aandrey
2014/07/28 14:14:43
remove asyncStackTrace argument
|
+ log("Paused in breakpoint"); |
+ // drop external stack references |
+ log(stacktrace.slice(0, stacktrace.indexOf('2)')).trim()); |
aandrey
2014/07/28 14:14:43
you can drop everything except the top call frame
|
+ |
+ pane._removeBreakpoint('instrumentation:close'); |
+ next(); |
+ } |
+ } |
+ ]); |
+ |
+} |
+</script> |
+</head> |
+<body onload="onload()"> |
+<p>Tests the window close breakpoint. |
+</p> |
+</body> |
+</html> |