blob: 4987ef6751153f20d6640ad26bf830d968c2662b [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 internal scripts unknown to front-end are processed correctly when appear in debugger call frames. Bug 64995\n`);
await TestRunner.loadModule('sources_test_runner');
await TestRunner.showPanel('sources');
await TestRunner.loadHTML(`
<p>Tests that internal scripts unknown to front-end are processed correctly when appear in debugger call frames.
<a href="https://bugs.webkit.org/show_bug.cgi?id=64995">Bug 64995</a>
</p>
`);
await TestRunner.evaluateInPagePromise(`
function testFunction()
{
var array = [2, 5, 7];
var sum = 0;
array.forEach(function(key)
{
sum += array[key];
});
return sum;
}
`);
SourcesTestRunner.runDebuggerTestSuite([function testSetBreakpoint(next) {
SourcesTestRunner.showScriptSource(
'pause-in-internal-script.js', didShowScriptSource);
var breakpointFunctionFrame = null;
async function didShowScriptSource(sourceFrame) {
breakpointFunctionFrame = sourceFrame;
TestRunner.addResult('Script source was shown.');
await SourcesTestRunner.setBreakpoint(sourceFrame, 21, '', true);
SourcesTestRunner.runTestFunctionAndWaitUntilPaused(didPause);
}
async function didPause(callFrames) {
await SourcesTestRunner.captureStackTrace(callFrames);
SourcesTestRunner.removeBreakpoint(breakpointFunctionFrame, 21);
next();
}
}]);
})();