Skip to content

Commit

Permalink
Move the transfer object into WindowPostMessageOptions
Browse files Browse the repository at this point in the history
Spec changes were requested and this change matches the spec changes.
whatwg/html#3799

BUG=861735

Change-Id: Ie5f33e6d52eb5d904ae3c439ee488ab75a3b514d
Reviewed-on: https://chromium-review.googlesource.com/1151388
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Mustaq Ahmed <mustaq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579152}
  • Loading branch information
dtapuska authored and Chrome-bot committed Jul 30, 2018
1 parent fe2c977 commit e46eb56
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 33 deletions.
2 changes: 1 addition & 1 deletion webmessaging/with-options/broken-origin.tentative.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<script>
test(function() {
assert_throws('SYNTAX_ERR', function() {
postMessage('', [], {targetOrigin: 'http://foo bar'});
postMessage('', {targetOrigin: 'http://foo bar'});
}, 'should have failed to resolve');
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div id="log"></div>
<script>
async_test(function() {
postMessage('', [], {targetOrigin: location.protocol + '//' + location.host + '//'});
postMessage('', {targetOrigin: location.protocol + '//' + location.host + '//'});
onmessage = this.step_func(function(e) {
assert_equals(e.origin, location.protocol + '//' + location.host);
this.done();
Expand Down
10 changes: 0 additions & 10 deletions webmessaging/with-options/invalid-args.tentative.html

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<script>
async_test(function(t) {
var channel = new MessageChannel();
postMessage('', [channel.port1, channel.port2], {targetOrigin: '*'});
postMessage('', {targetOrigin: '*', transfer: [channel.port1, channel.port2]});
onmessage = t.step_func(function(e) {
assert_equals(e.ports.length, 2);
t.done();
Expand Down
2 changes: 1 addition & 1 deletion webmessaging/with-options/no-target-origin.tentative.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div id="log"></div>
<script>
async_test(function() {
postMessage('', [], {});
postMessage('', {});
onmessage = this.step_func(function(e) {
assert_equals(e.data, '');
this.done();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!doctype html>
<title>null arg two interpreted as null string</title>
<title>null transfer</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
test(function(t) {
assert_throws(new SyntaxError, () => postMessage('', null));
assert_throws(new TypeError, () => postMessage('', {transfer: null}));
});
</script>
2 changes: 1 addition & 1 deletion webmessaging/with-options/slash-origin.tentative.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div id="log"></div>
<script>
async_test(function() {
postMessage('', [], {targetOrigin: '/'});
postMessage('', {targetOrigin: '/'});
onmessage = this.step_func(function(e) {
assert_equals(e.data, '');
this.done();
Expand Down
14 changes: 0 additions & 14 deletions webmessaging/with-options/two-arg.tentative.html

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div id=log></div>
<script>
async_test(function() {
postMessage('', undefined);
postMessage('', {transfer: undefined});
onmessage = this.step_func(function(e) {
assert_array_equals(e.ports, []);
this.done();
Expand Down
2 changes: 1 addition & 1 deletion webmessaging/with-options/unknown-parameter.tentative.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div id="log"></div>
<script>
async_test(function() {
postMessage('', [], {someBogusParameterOnThisDictionary: 'food'});
postMessage('', {someBogusParameterOnThisDictionary: 'food'});
onmessage = this.step_func(function(e) {
assert_equals(e.data, '');
this.done();
Expand Down

0 comments on commit e46eb56

Please sign in to comment.