⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 264181 in webkit


Ignore:
Timestamp:
Jul 9, 2020, 11:21:38 AM (6 years ago)
Author:
Chris Dumez
Message:

Resync web-platform-tests/webmessaging from upstream
​https://bugs.webkit.org/show_bug.cgi?id=214143

Reviewed by Sam Weinig.

Resync web-platform-tests/webmessaging from upstream cef93b58e7cf31f1d47.

  • resources/import-expectations.json:
  • web-platform-tests/webmessaging/*: Updated.
Location:
trunk/LayoutTests/imported/w3c
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r264176 r264181  
     12020-07-09  Chris Dumez  <cdumez@apple.com>
     2
     3        Resync web-platform-tests/webmessaging from upstream
     4        https://bugs.webkit.org/show_bug.cgi?id=214143
     5
     6        Reviewed by Sam Weinig.
     7
     8        Resync web-platform-tests/webmessaging from upstream cef93b58e7cf31f1d47.
     9
     10        * resources/import-expectations.json:
     11        * web-platform-tests/webmessaging/*: Updated.
     12
    1132020-07-09  Clark Wang  <clark_wang@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/resources/import-expectations.json

    r264038 r264181  
    406406    "web-platform-tests/webdriver": "skip",
    407407    "web-platform-tests/webgl": "skip",
    408     "web-platform-tests/webmessaging": "skip",
     408    "web-platform-tests/webmessaging": "import",
    409409    "web-platform-tests/webmessaging/": "import",
    410410    "web-platform-tests/webrtc": "import",
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/Channel_postMessage_DataCloneErr.htm

    r233197 r264181  
    1717        channel.port1.start();
    1818
    19         assert_throws("DATA_CLONE_ERR", function()
     19        assert_throws_dom("DATA_CLONE_ERR", function()
    2020        {
    2121            channel.port1.postMessage(navigator);
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/Channel_postMessage_clone_port_error.htm

    r233197 r264181  
    1717        channel.port1.start();
    1818
    19         assert_throws("DATA_CLONE_ERR", function()
     19        assert_throws_dom("DATA_CLONE_ERR", function()
    2020        {
    2121            channel.port1.postMessage("ports", [channel.port1]);
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/Channel_postMessage_ports_readonly_array.htm

    r233197 r264181  
    2929    {
    3030        var channel3 = new MessageChannel();
    31         assert_throws(new TypeError(), () => {
     31        assert_throws_js(TypeError, () => {
    3232            evt.ports.push(channel3.port1);
    3333        }, "ports is a frozen object");
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/MessageEvent.html

    r233197 r264181  
    2222test(function() {
    2323  var event = new MessageEvent("message");
    24   assert_throws(new TypeError(), function() {
     24  assert_throws_js(TypeError, function() {
    2525    event.initMessageEvent();
    2626  }, "Not enough arguments to initMessageEvent");
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/basics-expected.txt

    r233197 r264181  
    33FAIL messages are delivered in port creation order Can't find variable: BroadcastChannel
    44FAIL messages aren't delivered to a closed port Can't find variable: BroadcastChannel
     5FAIL messages aren't delivered to a port closed after calling postMessage. Can't find variable: BroadcastChannel
    56FAIL closing and creating channels during message delivery works correctly Can't find variable: BroadcastChannel
    6 FAIL Closing a channel in onmessage doesn't cancel already queued events Can't find variable: BroadcastChannel
     7FAIL Closing a channel in onmessage prevents already queued tasks from firing onmessage events Can't find variable: BroadcastChannel
    78
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/basics.html

    r233197 r264181  
    7070  }, 'messages aren\'t delivered to a closed port');
    7171
     72 async_test(t => {
     73    let c1 = new BroadcastChannel('closed');
     74    let c2 = new BroadcastChannel('closed');
     75    let c3 = new BroadcastChannel('closed');
     76
     77    c2.onmessage = t.unreached_func();
     78    c3.onmessage = t.step_func(() => t.done());
     79    c1.postMessage('test');
     80    c2.close();
     81}, 'messages aren\'t delivered to a port closed after calling postMessage.');
     82
    7283async_test(t => {
    7384    let c1 = new BroadcastChannel('create-in-onmessage');
    … …  
    8899  }, 'closing and creating channels during message delivery works correctly');
    89100
    90 // TODO(mek): Depending on https://github.com/whatwg/html/issues/1371 adjust
    91 // this test to match the correct behavior.
    92101async_test(t => {
    93102    let c1 = new BroadcastChannel('close-in-onmessage');
    … …  
    109118              'c2: first',
    110119              'c3: first',
    111               'c2: done',
    112120              'c3: done']);
    113121          t.done();
    … …  
    116124    c1.postMessage('first');
    117125    c1.postMessage('done');
    118   }, 'Closing a channel in onmessage doesn\'t cancel already queued events');
     126  }, 'Closing a channel in onmessage prevents already queued tasks from firing onmessage events');
    119127
    120128</script>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/interface-expected.txt

    r233197 r264181  
    11
    2 FAIL Should throw if no name is provided assert_throws: function "() => new BroadcastChannel()" threw object "ReferenceError: Can't find variable: BroadcastChannel" ("ReferenceError") expected object "TypeError" ("TypeError")
     2FAIL Should throw if no name is provided assert_throws_js: function "() => new BroadcastChannel()" threw object "ReferenceError: Can't find variable: BroadcastChannel" ("ReferenceError") expected instance of function "function TypeError() {
     3    [native code]
     4}" ("TypeError")
    35FAIL Null name should not throw Can't find variable: BroadcastChannel
    46FAIL Undefined name should not throw Can't find variable: BroadcastChannel
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/interface.html

    r233197 r264181  
    55<script>
    66
    7 test(() => assert_throws(new TypeError(), () => new BroadcastChannel()),
     7test(() => assert_throws_js(TypeError, () => new BroadcastChannel()),
    88  'Should throw if no name is provided');
    99
    … …  
    3030test(() => {
    3131    let c = new BroadcastChannel('');
    32     assert_throws(new TypeError(), () => c.postMessage());
     32    assert_throws_js(TypeError, () => c.postMessage());
    3333  }, 'postMessage without parameters should throw');
    3434
    … …  
    5252    let c = new BroadcastChannel('');
    5353    c.close();
    54     assert_throws('InvalidStateError', () => c.postMessage(''));
     54    assert_throws_dom('InvalidStateError', () => c.postMessage(''));
    5555  }, 'postMessage after close should throw');
    5656
    … …  
    6262test(() => {
    6363    let c = new BroadcastChannel('');
    64     assert_throws('DataCloneError', () => c.postMessage(Symbol()));
     64    assert_throws_dom('DataCloneError', () => c.postMessage(Symbol()));
    6565  }, 'postMessage should throw with uncloneable data');
    6666
    … …  
    6868    let c = new BroadcastChannel('');
    6969    c.close();
    70     assert_throws('InvalidStateError', () => c.postMessage(Symbol()));
     70    assert_throws_dom('InvalidStateError', () => c.postMessage(Symbol()));
    7171  }, 'postMessage should throw InvalidStateError after close, even with uncloneable data');
    7272
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/event.data.sub.htm

    r233197 r264181  
    1010
    1111<div style="display:none">
    12     <iframe width="70%" onload="PostMessageTest()" src="{{location[scheme]}}://{{domains[www]}}:{{location[port]}}/webmessaging/support/ChildWindowPostMessage.htm"></iframe>
     12    <iframe width="70%" onload="PostMessageTest()" src="{{location[scheme]}}://{{hosts[alt][]}}:{{location[port]}}/webmessaging/support/ChildWindowPostMessage.htm"></iframe>
    1313    <iframe width="70%" onload="PostMessageTest()" src="./support/ChildWindowPostMessage.htm"></iframe>
    1414</div>
    … …  
    2626    var TARGET1 = document.querySelectorAll("iframe")[0];
    2727    var TARGET2 = document.querySelectorAll("iframe")[1];
    28     var XORIGIN = "{{location[scheme]}}://{{domains[www]}}" + PORT;
     28    var XORIGIN = "{{location[scheme]}}://{{hosts[alt][]}}" + PORT;
    2929    var SORIGIN = "{{location[scheme]}}://{{host}}" + PORT;
    3030    var ExpectedResult = [DATA, TYPE, DATA, TYPE];
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/message-channels/close-expected.txt

    r233197 r264181  
    55PASS Inflight messages should be delivered even when sending port is closed afterwards.
    66PASS Close in onmessage should not cancel inflight messages.
    7 FAIL close() detaches a MessagePort (but not the one its entangled with) assert_throws: function "() => self.postMessage(null, "*", [c.port1])" did not throw
     7FAIL close() detaches a MessagePort (but not the one its entangled with) assert_throws_dom: function "() => self.postMessage(null, "*", [c.port1])" did not throw
    88
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/message-channels/close.html

    r233197 r264181  
    6363    const c = new MessageChannel();
    6464    c.port1.close();
    65     assert_throws("DataCloneError", () => self.postMessage(null, "*", [c.port1]));
     65    assert_throws_dom("DataCloneError", () => self.postMessage(null, "*", [c.port1]));
    6666    self.postMessage(null, "*", [c.port2]);
    6767}, "close() detaches a MessagePort (but not the one its entangled with)");
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/postMessage_ArrayBuffer.sub.htm

    r233197 r264181  
    1010
    1111<div style="display:none">
    12     <iframe width="70%" onload="PostMessageTest()" src="{{location[scheme]}}://{{domains[www]}}:{{location[port]}}/webmessaging/support/ChildWindowPostMessage.htm"></iframe>
     12    <iframe width="70%" onload="PostMessageTest()" src="{{location[scheme]}}://{{hosts[alt][]}}:{{location[port]}}/webmessaging/support/ChildWindowPostMessage.htm"></iframe>
    1313</div>
    1414
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/postMessage_Document.htm

    r233197 r264181  
    2626        test(function()
    2727        {
    28             assert_throws("DATA_CLONE_ERR", function()
     28            assert_throws_dom("DATA_CLONE_ERR", TARGET.contentWindow.DOMException, function()
    2929            {
    3030                TARGET.contentWindow.postMessage(DATA, "*");
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/postMessage_Function.htm

    r233197 r264181  
    2626        test(function()
    2727        {
    28             assert_throws("DATA_CLONE_ERR", function()
     28            assert_throws_dom("DATA_CLONE_ERR", TARGET.contentWindow.DOMException, function()
    2929            {
    3030                TARGET.contentWindow.postMessage(DATA, "*");
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/postMessage_arrays.sub.htm

    r233197 r264181  
    1010
    1111<div style="display:none">
    12     <iframe width="70%" onload="PostMessageTest()" src="{{location[scheme]}}://{{domains[www]}}:{{location[port]}}/webmessaging/support/ChildWindowPostMessage.htm"></iframe>
     12    <iframe width="70%" onload="PostMessageTest()" src="{{location[scheme]}}://{{hosts[alt][]}}:{{location[port]}}/webmessaging/support/ChildWindowPostMessage.htm"></iframe>
    1313</div>
    1414
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/postMessage_asterisk_xorigin.sub.htm

    r233197 r264181  
    1010
    1111<div style="display:none">
    12     <iframe width="70%" onload="PostMessageTest()" src="{{location[scheme]}}://{{domains[www]}}:{{location[port]}}/webmessaging/support/ChildWindowPostMessage.htm"></iframe>
     12    <iframe width="70%" onload="PostMessageTest()" src="{{location[scheme]}}://{{hosts[alt][]}}:{{location[port]}}/webmessaging/support/ChildWindowPostMessage.htm"></iframe>
    1313    <iframe width="70%" onload="PostMessageTest()" src="./support/ChildWindowPostMessage.htm"></iframe>
    1414</div>
    … …  
    2424    var TARGET1 = document.querySelectorAll("iframe")[0];
    2525    var TARGET2 = document.querySelectorAll("iframe")[1];
    26     var XORIGIN = "{{location[scheme]}}://{{domains[www]}}" + PORT;
     26    var XORIGIN = "{{location[scheme]}}://{{hosts[alt][]}}" + PORT;
    2727    var SORIGIN = "{{location[scheme]}}://{{host}}" + PORT;
    2828    var ExpectedResult = ["#1", XORIGIN, "#2", SORIGIN];
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/postMessage_dup_transfer_objects.htm

    r233197 r264181  
    2626        test(function()
    2727        {
    28             assert_throws("DATA_CLONE_ERR", function()
     28            assert_throws_dom("DATA_CLONE_ERR", TARGET.contentWindow.DOMException, function()
    2929            {
    3030                assert_own_property(window, "MessageChannel", "window");
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/postMessage_invalid_targetOrigin.htm

    r233197 r264181  
    2828        test(function()
    2929        {
    30             assert_throws("SYNTAX_ERR", function()
     30            assert_throws_dom("SYNTAX_ERR", TARGET.contentWindow.DOMException, function()
    3131            {
    3232                TARGET.contentWindow.postMessage(DATA, DATA);
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/postMessage_objects.sub.htm

    r233197 r264181  
    1010
    1111<div style="display:none">
    12     <iframe width="70%" onload="PostMessageTest()" src="{{location[scheme]}}://{{domains[www]}}:{{location[port]}}/webmessaging/support/ChildWindowPostMessage.htm"></iframe>
     12    <iframe width="70%" onload="PostMessageTest()" src="{{location[scheme]}}://{{hosts[alt][]}}:{{location[port]}}/webmessaging/support/ChildWindowPostMessage.htm"></iframe>
    1313</div>
    1414
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/broken-origin.html

    r253451 r264181  
    66<script>
    77test(function() {
    8   assert_throws('SYNTAX_ERR', function() {
     8  assert_throws_dom('SYNTAX_ERR', function() {
    99    postMessage('', {targetOrigin: 'http://foo bar'});
    1010  }, 'should have failed to resolve');
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-options/null-transfer.html

    r253451 r264181  
    66<script>
    77test(function(t) {
    8   assert_throws(new TypeError, () => postMessage('', {transfer: null}));
     8  assert_throws_js(TypeError, () => postMessage('', {transfer: null}));
    99});
    1010</script>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-ports/001.html

    r233197 r264181  
    66<script>
    77test(function() {
    8   assert_throws('SYNTAX_ERR', function() {
     8  assert_throws_dom('SYNTAX_ERR', function() {
    99    postMessage('', 'http://foo bar', []);
    1010  }, 'should have failed to resolve');
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-ports/003.html

    r233197 r264181  
    66<script>
    77test(function() {
    8   assert_throws('SYNTAX_ERR', function() {
     8  assert_throws_dom('SYNTAX_ERR', function() {
    99    postMessage('', 'example.org', []);
    1010  }, 'targetOrigin is not an absolute url');
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-ports/023.html

    r233197 r264181  
    66<script>
    77test(function(t) {
    8   assert_throws(new TypeError, () => postMessage('', '*', null));
     8  assert_throws_js(TypeError, () => postMessage('', '*', null));
    99});
    1010</script>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-ports/025.html

    r233197 r264181  
    66<script>
    77test(function() {
    8    assert_throws(new TypeError(), function() {
     8   assert_throws_js(TypeError, function() {
    99      postMessage('', '*', 1);
    1010   });
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-ports/026.html

    r233197 r264181  
    66<script>
    77test(function() {
    8    assert_throws(new TypeError(), function() {
     8   assert_throws_js(TypeError, function() {
    99      postMessage('', '*', {length:1});
    1010   });
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/with-ports/027.html

    r233197 r264181  
    1919  channel[1] = channel.port2;
    2020  channel.length = 2;
    21   assert_throws(new TypeError(),
    22                 () => { postMessage('', '*', channel) },
    23                 'Old-style WebIDL arrays must throw a type error');
     21  assert_throws_js(TypeError,
     22                   () => { postMessage('', '*', channel) },
     23                   'Old-style WebIDL arrays must throw a type error');
    2424}, "Old-style array objects");
    2525</script>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/without-ports/001.html

    r233197 r264181  
    66<script>
    77test(function() {
    8   assert_throws('SYNTAX_ERR', function() {
     8  assert_throws_dom('SYNTAX_ERR', function() {
    99    postMessage('', 'http://foo bar');
    1010  }, 'should have failed to resolve');
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/without-ports/003.html

    r233197 r264181  
    66<script>
    77test(function() {
    8   assert_throws('SYNTAX_ERR', function() {
     8  assert_throws_dom('SYNTAX_ERR', function() {
    99    postMessage('', 'example.org');
    1010  }, 'targetOrigin is not an absolute url');
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/without-ports/009.html

    r233197 r264181  
    66<script>
    77test(function() {
    8   assert_throws(new TypeError(), function() {
     8  assert_throws_js(TypeError, function() {
    99    postMessage();
    1010  });
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/without-ports/024.html

    r233197 r264181  
    1010  ch.port1.onmessage = function(){};
    1111  ch.port2.start();
    12   assert_throws('DATA_CLONE_ERR', function() { ch.port2.postMessage({obj: obj}); });
     12  assert_throws_dom('DATA_CLONE_ERR', function() { ch.port2.postMessage({obj: obj}); });
    1313});
    1414</script>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/without-ports/025-1.js

    r233197 r264181  
    88
    99test(function() {
    10   assert_throws(new TypeError(), function() {
     10  assert_throws_js(TypeError, function() {
    1111    new MessagePort()
    1212  }, "MessagePort is [[Callable]]");
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/without-ports/025.html

    r233197 r264181  
    88   var ch = new MessageChannel();
    99   assert_true(ch.port1 instanceof MessagePort, "MessageChannel's port not an instance of MessagePort");
    10    assert_throws(new TypeError(), function () { var p = new MessagePort();}, "MessagePort is [[Callable]]");
     10   assert_throws_js(TypeError, function () { var p = new MessagePort();}, "MessagePort is [[Callable]]");
    1111});
    1212fetch_tests_from_worker(new Worker("025-1.js"));
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/without-ports/026.html

    r233197 r264181  
    77async_test(function() {
    88   var obj = {};
    9    obj.__defineGetter__( "field", function(){ throw new Error("getter_should_propagate_exceptions"); });
     9   var err = new Error("getter_should_propagate_exceptions");
     10   obj.__defineGetter__( "field", function(){ throw err });
    1011
    11    assert_throws(new Error("getter_should_propagate_exceptions"), function() {
     12   assert_throws_exactly(err, function() {
    1213     postMessage(obj, '*');
    1314  });
Note: See TracChangeset for help on using the changeset viewer.