Use a .worker.js test

This commit is contained in:
Manish Goregaokar 2016-02-04 19:01:49 +05:30
parent 853d4c0e39
commit 396533c479
4 changed files with 24 additions and 44 deletions

View file

@ -0,0 +1,21 @@
importScripts("/resources/testharness.js");
importScripts('websocket.js?pipe=sub')
var data = "test data";
async_test(function(t) {
var wsocket = CreateWebSocket(false, false, false);
wsocket.addEventListener('open', function (e) {
wsocket.send(data)
}, true)
wsocket.addEventListener('message', t.step_func_done(function(e) {
assert_equals(e.data, data);
done();
}), true);
}, "W3C WebSocket API - Send data on a WebSocket in a Worker")