mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-08 12:37:37 +00:00
36db9eff13
--HG-- extra : transplant_source : o%29%0E%5D%90%11%FA%1ExO%26%7E%9D_%F2%E7%0B%FE%21%B2
58 lines
1.4 KiB
HTML
58 lines
1.4 KiB
HTML
<!--
|
|
Any copyright is dedicated to the Public Domain.
|
|
http://creativecommons.org/publicdomain/zero/1.0/
|
|
-->
|
|
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title>Bug 1039846 - Test fetch() function in worker</title>
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
</head>
|
|
<body>
|
|
<p id="display"></p>
|
|
<div id="content" style="display: none"></div>
|
|
<pre id="test"></pre>
|
|
<script type="text/javascript" src="worker_test_fetch_basic.js"> </script>
|
|
<script class="testbody" type="text/javascript">
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
function testOnWorker(done) {
|
|
ok(true, "=== Start Worker Tests ===");
|
|
var worker = new Worker("worker_test_fetch_basic.js");
|
|
worker.onmessage = function(event) {
|
|
if (event.data.type == "finish") {
|
|
ok(true, "=== Finish Worker Tests ===");
|
|
done();
|
|
} else if (event.data.type == "status") {
|
|
ok(event.data.status, event.data.msg);
|
|
}
|
|
}
|
|
|
|
worker.onerror = function(event) {
|
|
ok(false, "Worker had an error: " + event.data);
|
|
ok(true, "=== Finish Worker Tests ===");
|
|
done();
|
|
};
|
|
|
|
worker.postMessage("start");
|
|
}
|
|
|
|
//
|
|
// Driver
|
|
//
|
|
|
|
SpecialPowers.pushPrefEnv({"set": [
|
|
["dom.fetch.enabled", true]
|
|
]}, function() {
|
|
testOnWorker(function() {
|
|
SimpleTest.finish();
|
|
});
|
|
});
|
|
</script>
|
|
</script>
|
|
</pre>
|
|
</body>
|
|
</html>
|
|
|