summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webmessaging/MessageEvent.any.js
blob: 0fb2636911ddc6ebc6026f20d8e18a2aa9007404 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// META: title=MessageEvent

var prefixes = ['moz', 'ms', 'o', 'webkit'];
prefixes.forEach(function(prefix) {
  var name = prefix + "InitMessageEvent";

  test(function() {
    assert_false(name in MessageEvent.prototype);
  }, name + " on the prototype");

  test(function() {
    var event = new MessageEvent("message");
    assert_false(name in event);
  }, name + " on the instance");
});

test(function() {
  var event = new MessageEvent("message");
  assert_throws_js(TypeError, function() {
    event.initMessageEvent();
  }, "Not enough arguments to initMessageEvent");
}, "initMessageEvent with no arguments");