tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

005.html (842B)


      1 <!doctype html>
      2 <title>WebSockets: Send/Receive ArrayBuffer, size less than network array buffer</title>
      3 <script src=/resources/testharness.js></script>
      4 <script src=/resources/testharnessreport.js></script>
      5 <script src=../constants.sub.js></script>
      6 <meta name="variant" content="?default">
      7 <meta name="variant" content="?wss">
      8 <meta name="variant" content="?wpt_flags=h2">
      9 <div id=log></div>
     10 <script>
     11 async_test(function(t){
     12  var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/echo');
     13  var data = "";
     14  var datasize = 10;
     15  ws.onopen = t.step_func(function(e) {
     16   ws.binaryType = "arraybuffer";
     17   data = new ArrayBuffer(datasize);
     18   ws.send(data);
     19  });
     20  ws.onmessage = t.step_func(function(e) {
     21    assert_equals(e.data.byteLength, datasize);
     22    t.done();
     23  });
     24  ws.onclose = t.unreached_func('close event should not fire');
     25 });
     26 </script>