v8/test/inspector/debugger/evaluate-on-call-frame-timeout.js
Alexey Kozyatinskiy c1e4885f7d Reland "[inspector] added timeout for Debugger.evaluateOnCallFrame method"
This is a reland of 436faae044

Original change's description:
> [inspector] added timeout for Debugger.evaluateOnCallFrame method
> 
> R=dgozman@chromium.org,yangguo@chromium.org
> 
> Bug: none
> Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
> Change-Id: I569899f245190ca2fa720bdb837db1263e8058d5
> Reviewed-on: https://chromium-review.googlesource.com/1023035
> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52798}

Bug: none
Change-Id: I91219382b5dc45b54dd8e5c64d9f0d11c849b9c8
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
Reviewed-on: https://chromium-review.googlesource.com/1030510
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52818}
2018-04-26 15:08:52 +00:00

41 lines
1.2 KiB
JavaScript

// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
const {Protocol} = InspectorTest.start(
`Tests that Debugger.evaluateOnCallFrame's timeout argument`);
(async function test(){
Protocol.Debugger.enable();
Protocol.Runtime.evaluate({expression: "debugger;"});
const {params:{callFrames:[{callFrameId}]}} = await Protocol.Debugger.oncePaused();
{
InspectorTest.log('Run trivial expression:');
const result = await Protocol.Debugger.evaluateOnCallFrame({
callFrameId,
expression: 'function foo() {} foo()',
timeout: 0
});
InspectorTest.log('Evaluate finished!');
}
{
InspectorTest.log('Run expression without interrupts:');
const result = await Protocol.Debugger.evaluateOnCallFrame({
callFrameId,
expression: '',
timeout: 0
});
InspectorTest.log('Evaluate finished!');
}
{
InspectorTest.log('Run infinite loop:');
const result = await Protocol.Debugger.evaluateOnCallFrame({
callFrameId,
expression: 'for(;;){}',
timeout: 0
});
InspectorTest.log('Evaluate finished!');
}
InspectorTest.completeTest();
})();