Bug 1134224 - More test for test_bug1132395.html, r=ehsan

This commit is contained in:
Andrea Marchesini 2015-06-04 08:58:19 +01:00
parent c25fcf5d9b
commit b3bf0365e0
2 changed files with 12 additions and 0 deletions

View File

@ -1,7 +1,12 @@
dump("SW created\n");
onconnect = function(evt) {
dump("SW onconnect\n");
evt.ports[0].onmessage = function(e) {
dump("SW onmessage\n");
var blob = new Blob(['123'], { type: 'text/plain' });
dump("SW blob created\n");
var url = URL.createObjectURL(blob);
dump("SW url created: " + url + "\n");
evt.ports[0].postMessage('alive \\o/');
};
}

View File

@ -13,13 +13,20 @@
<script class="testbody" type="text/javascript">
// This test is full of dummy debug messages. This is because I need to follow
// an hard-to-reproduce timeout failure.
info("test started");
SpecialPowers.pushPrefEnv({ set: [["dom.workers.sharedWorkers.enabled", true]] }, function() {
info("test started");
var sw = new SharedWorker('bug1132395_sharedWorker.js');
sw.port.onmessage = function(event) {
info("sw.onmessage received");
ok(true, "We didn't crash.");
SimpleTest.finish();
}
info("sw.postmessage called");
sw.port.postMessage('go');
});