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 | 4 |
5 print('Checks that breaks in framework code correctly processed.'); | 5 print('Checks that breaks in framework code correctly processed.'); |
6 | 6 |
7 InspectorTest.addScript( | 7 InspectorTest.addScript( |
8 ` | 8 ` |
9 function frameworkAssert() { | 9 function frameworkAssert() { |
10 console.assert(false); | 10 console.assert(false); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 {expression: 'throwCaughtError()//# sourceURL=user.js'})) | 91 {expression: 'throwCaughtError()//# sourceURL=user.js'})) |
92 .then(() => Protocol.Debugger.setPauseOnExceptions({state: 'none'})) | 92 .then(() => Protocol.Debugger.setPauseOnExceptions({state: 'none'})) |
93 .then(next); | 93 .then(next); |
94 }, | 94 }, |
95 | 95 |
96 function testUncaughtException(next) { | 96 function testUncaughtException(next) { |
97 Protocol.Debugger.setPauseOnExceptions({state: 'all'}) | 97 Protocol.Debugger.setPauseOnExceptions({state: 'all'}) |
98 .then(() => InspectorTest.log('> all frames in framework:')) | 98 .then(() => InspectorTest.log('> all frames in framework:')) |
99 .then( | 99 .then( |
100 () => Protocol.Runtime.evaluate( | 100 () => Protocol.Runtime.evaluate( |
101 {expression: 'throwUncaughtError()//# sourceURL=framework.js'})) | 101 {expression: 'setTimeout(\'throwUncaughtError()//# sourceURL=fra
mework.js\', 0)//# sourceURL=framework.js'})) |
102 .then(() => InspectorTest.log('> mixed, top frame in framework:')) | 102 .then(() => InspectorTest.log('> mixed, top frame in framework:')) |
| 103 .then(() => Protocol.Runtime.evaluate({ expression: "new Promise(resolve
=> setTimeout(resolve, 0))", awaitPromise: true})) |
103 .then( | 104 .then( |
104 () => Protocol.Runtime.evaluate( | 105 () => Protocol.Runtime.evaluate( |
105 {expression: 'throwUncaughtError()//# sourceURL=user.js'})) | 106 {expression: 'setTimeout(\'throwUncaughtError()//# sourceURL=use
r.js\', 0)'})) |
| 107 .then(() => Protocol.Runtime.evaluate({ expression: "new Promise(resolve
=> setTimeout(resolve, 0))", awaitPromise: true})) |
106 .then(() => Protocol.Debugger.setPauseOnExceptions({state: 'none'})) | 108 .then(() => Protocol.Debugger.setPauseOnExceptions({state: 'none'})) |
107 .then(next); | 109 .then(next); |
108 }, | 110 }, |
109 | 111 |
110 function testBreakpoint(next) { | 112 function testBreakpoint(next) { |
111 Protocol.Debugger.setBreakpointByUrl({lineNumber: 24, url: 'framework.js'}) | 113 Protocol.Debugger.setBreakpointByUrl({lineNumber: 24, url: 'framework.js'}) |
112 .then(() => InspectorTest.log('> all frames in framework:')) | 114 .then(() => InspectorTest.log('> all frames in framework:')) |
113 .then( | 115 .then( |
114 () => Protocol.Runtime.evaluate( | 116 () => Protocol.Runtime.evaluate( |
115 {expression: 'breakpoint()//# sourceURL=framework.js'})) | 117 {expression: 'breakpoint()//# sourceURL=framework.js'})) |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 () => Protocol.Runtime.evaluate( | 182 () => Protocol.Runtime.evaluate( |
181 {expression: 'throwFromJSONParse()//# sourceURL=framework.js'})) | 183 {expression: 'throwFromJSONParse()//# sourceURL=framework.js'})) |
182 .then(() => InspectorTest.log('> mixed, top frame in framework:')) | 184 .then(() => InspectorTest.log('> mixed, top frame in framework:')) |
183 .then( | 185 .then( |
184 () => Protocol.Runtime.evaluate( | 186 () => Protocol.Runtime.evaluate( |
185 {expression: 'throwFromJSONParse()//# sourceURL=user.js'})) | 187 {expression: 'throwFromJSONParse()//# sourceURL=user.js'})) |
186 .then(() => Protocol.Debugger.setPauseOnExceptions({state: 'none'})) | 188 .then(() => Protocol.Debugger.setPauseOnExceptions({state: 'none'})) |
187 .then(next); | 189 .then(next); |
188 } | 190 } |
189 ]); | 191 ]); |
OLD | NEW |