mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45:33 +01:00
Use a .worker.js test
This commit is contained in:
parent
853d4c0e39
commit
396533c479
4 changed files with 24 additions and 44 deletions
21
tests/wpt/web-platform-tests/websockets/Send-data.worker.js
Normal file
21
tests/wpt/web-platform-tests/websockets/Send-data.worker.js
Normal 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")
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue