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..ebf2e39c9aefad97ae986654426fb0419bfe8ae8 |
--- /dev/null |
+++ b/LayoutTests/inspector-enabled/sources/debugger/script-window-close-breakpoint.html |
@@ -0,0 +1,64 @@ |
+<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() |
+{ |
+ // This is needed because Inspector.addResult() uses output() which places elements |
+ // into the <body> which gets disposed along with the window |
+ function log(message) { |
+ InspectorTest.evaluateInPage("console.log(unescape('"+ escape(message) +"'));"); |
+ } |
+ |
+ 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) |
+ { |
+ log("Paused in breakpoint"); |
+ // get the first stack frame |
+ log(InspectorTest.captureStackTraceIntoString(callFrames).split('\n')[1].trim()); |
+ |
+ pane._removeBreakpoint('instrumentation:close'); |
+ next(); |
+ // After this point execution will resume and the window will close |
aandrey
2014/07/28 15:19:40
I think you should not use InspectorTest.runDebugg
|
+ } |
+ } |
+ ]); |
+ |
+} |
+</script> |
+</head> |
+<body onload="onload()"> |
+<p>Tests the window close breakpoint. |
+</p> |
+</body> |
+</html> |