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

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: use InspectorTest.startDebuggerTest 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.startDebuggerTest(testCloseBreakpoint);
35
36 function testCloseBreakpoint(next)
37 {
38 log("Setting breakpoint");
39 pane._setBreakpoint('instrumentation:close');
40
41 log("Calling window.close()");
42 InspectorTest.waitUntilPaused(paused);
43 InspectorTest.evaluateInPage("doClose()");
44
45 function paused(callFrames)
46 {
47 log("Paused in breakpoint");
48 // get the first stack frame
49 log(InspectorTest.captureStackTraceIntoString(callFrames).split('\n' )[1].trim());
50
51 pane._removeBreakpoint('instrumentation:close');
52 InspectorTest.completeDebuggerTest();
53 // After this point execution will resume and the window will close
54 }
55 }
56 }
57 </script>
58 </head>
59 <body onload="onload()">
60 <p>Tests the window close breakpoint.
61 </p>
62 </body>
63 </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