https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 36857c5f01b941752b8877902dccd8b7b01202be authored by Tooru Fujisawa on 02 October 2018, 08:23:59 UTC
Do not raise error if jstests.py is executed without virtualenv on non-automation.
Tip revision: 36857c5
eventhandlers.any.js
// META: script=websocket.sub.js

function testEventHandler(name) {
  test(function() {
    var ws = new WebSocket("ws://" + __SERVER__NAME + ":" + __PORT + "/" + __PATH,
      "echo")
    assert_equals(ws["on" + name], null);
    ws["on" + name] = function() {};
    ws["on" + name] = 2;
    assert_equals(ws["on" + name], null);
  }, "Event handler for " + name + " should have [TreatNonCallableAsNull]")
}
["open", "error", "close", "message"].forEach(testEventHandler);
back to top