blob: 9e68f7012b8f3cb19712fb6cb754e8283291f627 [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function() {
TestRunner.addResult(
`Tests that debugger StepInto will stop inside next timeout handler.\n`);
await TestRunner.loadModule('sources_test_runner');
await TestRunner.showPanel('sources');
await TestRunner.evaluateInPagePromise(`
function testFunction()
{
setTimeout(callback1, 0);
}
function callback1()
{
setTimeout(callback2, 0);
debugger;
}
function callback2()
{
var dummy = 42; // Should pause here.
(function FAIL_Should_Not_Pause_Here() { debugger; })();
}
`);
SourcesTestRunner.startDebuggerTest(step1, true);
function step1() {
SourcesTestRunner.runTestFunctionAndWaitUntilPaused(step2);
}
function step2() {
var actions = [
'Print', // "debugger" in callback1
'StepInto',
'StepInto',
'Print',
];
SourcesTestRunner.waitUntilPausedAndPerformSteppingActions(
actions, () => SourcesTestRunner.completeDebuggerTest());
}
})();