Files
sousa-gecko/devtools/client/webconsole/test/browser/test-console-workers.html
T
Nicolas Chevobbe 4c0129c06c Bug 1767724 - [devtools Fix browser_webconsole_console_logging_workers_api.js intermittent. r=devtools-reviewers,bomsy.
The test was calling `logFromWorker` twice, which means we were getting some duplicated
messages which could mess with some assertions. The second call wasn't even needed
so we can simply remove it.

Also, because the test was using a data url worker, in the test we were matching some
assertions not on the message body, but on the message location, which means we
weren't properly checking what we wanted, and possibly were triggering some actions
to early/late.

This patch migrates the worker content to an existing worker file that we then
use in the support file, so we don't match on the message location anymore.

Differential Revision: https://phabricator.services.mozilla.com/D246412
2025-04-24 07:52:03 +00:00

22 lines
600 B
HTML

<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!DOCTYPE HTML>
<html dir="ltr" xml:lang="en-US" lang="en-US"><head>
<meta charset="utf-8">
<title>Console test</title>
</head>
<body>
<script type="text/javascript">
"use strict";
/* exported logFromWorker */
const worker = new Worker("./test-worker.js");
function logFromWorker(message) {
const sab = new SharedArrayBuffer(1024);
worker.postMessage({type: "log-objects", message, sab});
}
</script>
</body>
</html>