https://github.com/web-platform-tests/wpt
Raw File
Tip revision: af678273b4059c687242b7a2bc1ebacffd1750c9 authored by Geoffrey Sneddon on 27 March 2018, 15:21:52 UTC
Move the config into its own class
Tip revision: af67827
Send-data.worker.js
importScripts("/resources/testharness.js");
importScripts('websocket.sub.js')

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")


back to top