Revision 3c9fd9d383c9adca4aa23a4f184fb469101e1d8f authored by Jonathon Kereliuk on 06 July 2018, 15:57:56 UTC, committed by GitHub on 06 July 2018, 15:57:56 UTC
2 parent s 8c77bf2 + a7affd5
Raw File
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