OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 // Flags: --max_old_space_size=4 |
| 5 |
| 6 print('Check pause on OOM'); |
| 7 |
| 8 InspectorTest.addScript(` |
| 9 var arr = []; |
| 10 var stop = false; |
| 11 function generateGarbage() { |
| 12 while(!stop) { |
| 13 arr.push(42); |
| 14 } |
| 15 } |
| 16 //# sourceURL=test.js`, 10, 26); |
| 17 |
| 18 Protocol.Debugger.onPaused((message) => { |
| 19 InspectorTest.log(`reason: ${message.params.reason}`); |
| 20 Protocol.Debugger.evaluateOnCallFrame({ |
| 21 callFrameId: message.params.callFrames[0].callFrameId, |
| 22 expression: 'arr = []; stop = true;' |
| 23 }).then(() => Protocol.Debugger.resume()); |
| 24 }); |
| 25 Protocol.Debugger.enable(); |
| 26 Protocol.Runtime.evaluate({ expression: 'generateGarbage()' }) |
| 27 .then(InspectorTest.completeTest); |
OLD | NEW |