blob: 46bb1551b3c1ce62049e842349a23ef1fd781ae5 [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 asynchronous call stacks for setInterval.\n`);
await TestRunner.loadModule('sources_test_runner');
await TestRunner.showPanel('sources');
await TestRunner.evaluateInPagePromise(`
var intervalId;
var count = 0;
function testFunction()
{
intervalId = setInterval(callback, 0);
}
function callback()
{
if (count === 0) {
debugger;
} else if (count === 1) {
debugger;
} else {
clearInterval(intervalId);
debugger;
}
++count;
}
`);
var totalDebuggerStatements = 3;
SourcesTestRunner.runAsyncCallStacksTest(totalDebuggerStatements);
})();