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
Родитель 2fba2d028e
Коммит 9e407c75be
2 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -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/');
};
}

Просмотреть файл

@ -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');
});