OLD | NEW |
1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // Flags: --allow-natives-syntax | 4 // Flags: --allow-natives-syntax |
5 | 5 |
6 InspectorTest.log('Checks that breaks in framework code correctly processed.'); | 6 let {session, contextGroup, Protocol} = InspectorTest.start('Checks that breaks
in framework code correctly processed.'); |
7 | 7 |
8 InspectorTest.addScript(` | 8 contextGroup.addScript(` |
9 function frameworkAssert() { | 9 function frameworkAssert() { |
10 console.assert(false); | 10 console.assert(false); |
11 } | 11 } |
12 | 12 |
13 function throwCaughtError() { | 13 function throwCaughtError() { |
14 try { | 14 try { |
15 throw new Error(); | 15 throw new Error(); |
16 } catch (e) { | 16 } catch (e) { |
17 } | 17 } |
18 } | 18 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 function syncDOMBreakpointWithInlinedUserFrame() { | 62 function syncDOMBreakpointWithInlinedUserFrame() { |
63 function inlinedWrapper() { | 63 function inlinedWrapper() { |
64 userFunction(); | 64 userFunction(); |
65 } | 65 } |
66 %OptimizeFunctionOnNextCall(inlinedWrapper); | 66 %OptimizeFunctionOnNextCall(inlinedWrapper); |
67 inlinedWrapper(); | 67 inlinedWrapper(); |
68 } | 68 } |
69 | 69 |
70 //# sourceURL=framework.js`, 8, 26); | 70 //# sourceURL=framework.js`, 8, 26); |
71 | 71 |
72 InspectorTest.addScript(` | 72 contextGroup.addScript(` |
73 function throwUserException() { | 73 function throwUserException() { |
74 throw new Error(); | 74 throw new Error(); |
75 } | 75 } |
76 | 76 |
77 function userFunction() { | 77 function userFunction() { |
78 syncDOMBreakpoint(); | 78 syncDOMBreakpoint(); |
79 } | 79 } |
80 | 80 |
81 //# sourceURL=user.js`, 64, 26) | 81 //# sourceURL=user.js`, 64, 26) |
82 | 82 |
83 InspectorTest.setupScriptMap(); | 83 session.setupScriptMap(); |
84 Protocol.Debugger.onPaused(message => { | 84 Protocol.Debugger.onPaused(message => { |
85 InspectorTest.logCallFrames(message.params.callFrames); | 85 session.logCallFrames(message.params.callFrames); |
86 InspectorTest.log(''); | 86 InspectorTest.log(''); |
87 Protocol.Debugger.resume(); | 87 Protocol.Debugger.resume(); |
88 }); | 88 }); |
89 | 89 |
90 Protocol.Debugger.enable(); | 90 Protocol.Debugger.enable(); |
91 Protocol.Debugger.setBlackboxPatterns({patterns: ['framework\.js']}); | 91 Protocol.Debugger.setBlackboxPatterns({patterns: ['framework\.js']}); |
92 | 92 |
93 InspectorTest.runTestSuite([ | 93 InspectorTest.runTestSuite([ |
94 function testConsoleAssert(next) { | 94 function testConsoleAssert(next) { |
95 Protocol.Debugger.setPauseOnExceptions({state: 'all'}) | 95 Protocol.Debugger.setPauseOnExceptions({state: 'all'}) |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 }, | 181 }, |
182 | 182 |
183 function testSyncDOMBreakpointWithInlinedUserFrame(next) { | 183 function testSyncDOMBreakpointWithInlinedUserFrame(next) { |
184 InspectorTest.log('> mixed, top frame in framework:'); | 184 InspectorTest.log('> mixed, top frame in framework:'); |
185 Protocol.Runtime | 185 Protocol.Runtime |
186 .evaluate({expression: 'syncDOMBreakpointWithInlinedUserFrame()//# sourc
eURL=framework.js'}) | 186 .evaluate({expression: 'syncDOMBreakpointWithInlinedUserFrame()//# sourc
eURL=framework.js'}) |
187 .then(next); | 187 .then(next); |
188 }, | 188 }, |
189 | 189 |
190 function testAsyncDOMBreakpoint(next) { | 190 function testAsyncDOMBreakpoint(next) { |
191 InspectorTest.contextGroup.schedulePauseOnNextStatement('', ''); | 191 contextGroup.schedulePauseOnNextStatement('', ''); |
192 InspectorTest.log('> all frames in framework:'); | 192 InspectorTest.log('> all frames in framework:'); |
193 Protocol.Runtime | 193 Protocol.Runtime |
194 .evaluate( | 194 .evaluate( |
195 {expression: 'asyncDOMBreakpoint()//# sourceURL=framework.js'}) | 195 {expression: 'asyncDOMBreakpoint()//# sourceURL=framework.js'}) |
196 .then(() => InspectorTest.contextGroup.cancelPauseOnNextStatement()) | 196 .then(() => contextGroup.cancelPauseOnNextStatement()) |
197 .then( | 197 .then( |
198 () => Protocol.Runtime.evaluate( | 198 () => Protocol.Runtime.evaluate( |
199 {expression: '42//# sourceURL=user.js'})) | 199 {expression: '42//# sourceURL=user.js'})) |
200 .then(() => InspectorTest.contextGroup.schedulePauseOnNextStatement('',
'')) | 200 .then(() => contextGroup.schedulePauseOnNextStatement('', '')) |
201 .then( | 201 .then( |
202 () => Protocol.Runtime.evaluate( | 202 () => Protocol.Runtime.evaluate( |
203 {expression: 'asyncDOMBreakpoint()//# sourceURL=user.js'})) | 203 {expression: 'asyncDOMBreakpoint()//# sourceURL=user.js'})) |
204 .then(next); | 204 .then(next); |
205 }, | 205 }, |
206 | 206 |
207 function testCaughtSyntaxError(next) { | 207 function testCaughtSyntaxError(next) { |
208 Protocol.Debugger.setPauseOnExceptions({state: 'all'}) | 208 Protocol.Debugger.setPauseOnExceptions({state: 'all'}) |
209 .then(() => InspectorTest.log('> all frames in framework:')) | 209 .then(() => InspectorTest.log('> all frames in framework:')) |
210 .then(() => Protocol.Runtime.evaluate({ | 210 .then(() => Protocol.Runtime.evaluate({ |
(...skipping 14 matching lines...) Expand all Loading... |
225 () => Protocol.Runtime.evaluate( | 225 () => Protocol.Runtime.evaluate( |
226 {expression: 'throwFromJSONParse()//# sourceURL=framework.js'})) | 226 {expression: 'throwFromJSONParse()//# sourceURL=framework.js'})) |
227 .then(() => InspectorTest.log('> mixed, top frame in framework:')) | 227 .then(() => InspectorTest.log('> mixed, top frame in framework:')) |
228 .then( | 228 .then( |
229 () => Protocol.Runtime.evaluate( | 229 () => Protocol.Runtime.evaluate( |
230 {expression: 'throwFromJSONParse()//# sourceURL=user.js'})) | 230 {expression: 'throwFromJSONParse()//# sourceURL=user.js'})) |
231 .then(() => Protocol.Debugger.setPauseOnExceptions({state: 'none'})) | 231 .then(() => Protocol.Debugger.setPauseOnExceptions({state: 'none'})) |
232 .then(next); | 232 .then(next); |
233 } | 233 } |
234 ]); | 234 ]); |
OLD | NEW |