tor-browser

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

009.html (777B)


      1 <!doctype html>
      2 <title>WebSockets: send('')</title>
      3 
      4 <script src=/resources/testharness.js></script>
      5 <script src=/resources/testharnessreport.js></script>
      6 <script src=../../../constants.sub.js></script>
      7 <meta name="variant" content="?default">
      8 <meta name="variant" content="?wss">
      9 <meta name="variant" content="?wpt_flags=h2">
     10 <div id=log></div>
     11 <script>
     12 async_test(function(t){
     13  var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/empty-message');
     14  ws.onopen = t.step_func(function(e) {
     15    ws.send('');
     16  })
     17  ws.onmessage = t.step_func(function(e) {
     18    assert_equals(e.data, 'pass');
     19    ws.close();
     20  });
     21  ws.onclose = t.step_func(function(e) {
     22    ws.onclose = t.unreached_func();
     23    t.step_timeout(() => t.done(), 50);
     24  });
     25  ws.onerror = t.unreached_func();
     26 });
     27 </script>