Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- Manifest: dom/workers/test/mochitest.toml
<!--
Any copyright is dedicated to the Public Domain.
-->
<!DOCTYPE HTML>
<html>
<head>
<script src="/tests/SimpleTest/SimpleTest.js">
</script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<script type="text/javascript">
const message = "hi";
const url = "DATA:text/plain," +
"onmessage = function(event) {" +
" postMessage(event.data);" +
"};";
var worker = new Worker(url);
worker.onmessage = function(event) {
is(event.data, message, "Got correct message");
SimpleTest.finish();
};
worker.postMessage(message);
SimpleTest.waitForExplicitFinish();
</script>
</body>
</html>