tor-browser

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

Close-onlyReason.any.js (567B)


      1 // META: script=constants.sub.js
      2 // META: variant=?default
      3 // META: variant=?wss
      4 // META: variant=?wpt_flags=h2
      5 
      6 var test = async_test("Create WebSocket - Close the Connection - close(only reason) - INVALID_ACCESS_ERR is thrown");
      7 
      8 var wsocket = CreateWebSocket(false, false);
      9 
     10 wsocket.addEventListener('open', test.step_func(function(evt) {
     11  assert_throws_dom("INVALID_ACCESS_ERR", function() {
     12    wsocket.close("Close with only reason")
     13  });
     14  test.done();
     15 }), true);
     16 
     17 wsocket.addEventListener('close', test.unreached_func('close event should not fire'), true);