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

Side by Side 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: add some comments, drop unused args, only catch one stack frame Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/inspector-enabled/sources/debugger/script-window-close-breakpoint-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 WebInspector.inspectorView.showPanel("sources");
33 var pane = WebInspector.panels.sources.sidebarPanes.eventListenerBreakpoints ;
34 InspectorTest.runDebuggerTestSuite([
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 next();
52 // After this point execution will resume and the window will cl ose
aandrey 2014/07/28 15:19:40 I think you should not use InspectorTest.runDebugg
53 }
54 }
55 ]);
56
57 }
58 </script>
59 </head>
60 <body onload="onload()">
61 <p>Tests the window close breakpoint.
62 </p>
63 </body>
64 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector-enabled/sources/debugger/script-window-close-breakpoint-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698