blob: d1a52156a9040a006d446b3a9aa321313e5633a8 [file] [log] [blame]
(async function() {
TestRunner.addResult(`Tests exception message from eval on nested worker context in console contains stack trace.\n`);
await TestRunner.loadModule('console_test_runner');
await TestRunner.showPanel('console');
await TestRunner.evaluateInPagePromise(`
function startWorker()
{
var worker = new Worker("resources/nested-worker.js");
}
`);
TestRunner.addSniffer(SDK.RuntimeModel.prototype, '_executionContextCreated', contextCreated);
TestRunner.evaluateInPage('startWorker()');
var contexts_still_loading = 2;
function contextCreated() {
contexts_still_loading--;
if (contexts_still_loading > 0) {
TestRunner.addSniffer(SDK.RuntimeModel.prototype, '_executionContextCreated', contextCreated);
return;
}
ConsoleTestRunner.changeExecutionContext('\u2699 worker.js');
ConsoleTestRunner.evaluateInConsole('\
function foo()\n\
{\n\
throw {a:239};\n\
}\n\
function boo()\n\
{\n\
foo();\n\
}\n\
boo();', step2);
}
function step2() {
ConsoleTestRunner.expandConsoleMessages(step3);
}
function step3() {
ConsoleTestRunner.dumpConsoleMessages();
TestRunner.completeTest();
}
})();