Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Unified Diff: LayoutTests/inspector-enabled/sources/debugger/script-window-close-breakpoint.html

Issue 401523004: Break on window close when the inspector is open (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: a working test Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..ce8c2b222947d087aab99f8e0a53d0f1f27df9c8
--- /dev/null
+++ b/LayoutTests/inspector-enabled/sources/debugger/script-window-close-breakpoint.html
@@ -0,0 +1,60 @@
+<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) {
+ InspectorTest.evaluateInPage("console.log('"+ 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, reason, breakpointIds, asyncStackTrace, auxData)
+ {
+ log("Paused in breakpoint");
pfeldman 2014/07/22 08:57:40 You should dump the stack here to test that it is
+ pane._removeBreakpoint('instrumentation:close');
+ next();
+ }
+ }
+ ]);
+
+}
+</script>
+</head>
+<body onload="onload()">
+<p>Tests the window close breakpoint.
+</p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698