blob: 8e05e7ab744dbc27b3803a8f445341955ffe36b0 [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 syntax errors in eval are logged into console, contains correct link and doesn't cause browser crash.\n`);
await TestRunner.loadModule('console_test_runner');
await TestRunner.showPanel('console');
await TestRunner.evaluateInPagePromise(`
function foo()
{
eval("}");
}
function boo()
{
eval("\\n}\\n//# sourceURL=boo.js");
}
`);
TestRunner.evaluateInPage('setTimeout(foo, 0);', ConsoleTestRunner.waitUntilMessageReceived.bind(this, step2));
function step2() {
TestRunner.evaluateInPage('setTimeout(boo, 0);', ConsoleTestRunner.waitUntilMessageReceived.bind(this, step3));
}
async function step3() {
await ConsoleTestRunner.dumpConsoleMessages();
TestRunner.completeTest();
}
})();