https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 622b6fd97abd374fdd18a783d12a684f3fa98e23 authored by Emil A Eklund on 18 December 2018, 22:56:53 UTC
Return resolved-value for ComputedStyle line-height
Tip revision: 622b6fd
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