Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
468 additions
and
52 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...s/wpt/mozilla/tests/mozilla/Channel_postMessage_with_second_transfer_in_timeout.window.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// META: script=/common/get-host-info.sub.js | ||
|
||
async_test(function(t) { | ||
var channel1 = new MessageChannel(); | ||
var channel2 = new MessageChannel(); | ||
var host = get_host_info(); | ||
let iframe = document.createElement('iframe'); | ||
iframe.src = host.HTTP_NOTSAMESITE_ORIGIN + "/webmessaging/support/ChildWindowPostMessage.htm"; | ||
document.body.appendChild(iframe); | ||
var TARGET = document.querySelector("iframe").contentWindow; | ||
iframe.onload = t.step_func(function() { | ||
|
||
// Send a message, expecting it to be received in the iframe. | ||
channel1.port2.postMessage(1) | ||
|
||
// First, transfer the port into the same realm. | ||
channel2.port2.postMessage(0, [channel1.port1]); | ||
|
||
channel2.port1.onmessage = t.step_func(function (evt) { | ||
assert_equals(Number(evt.data), 0); | ||
|
||
t.step_timeout(function () { | ||
// Transfer the port to the iframe. | ||
TARGET.postMessage("ports", "*", evt.ports); | ||
}, 0); | ||
}); | ||
|
||
channel1.port2.onmessage = t.step_func(function (evt) { | ||
assert_equals(Number(evt.data), 1); | ||
t.done(); | ||
}); | ||
}); | ||
}, `A port transferred outside of a onmessage handler does not lose messages along the way.`); |
43 changes: 43 additions & 0 deletions
43
...la/tests/mozilla/Channel_postMessage_with_second_transfer_in_timeout_with_delay.window.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// META: script=/common/get-host-info.sub.js | ||
|
||
async_test(function(t) { | ||
var channel1 = new MessageChannel(); | ||
var channel2 = new MessageChannel(); | ||
var host = get_host_info(); | ||
let iframe = document.createElement('iframe'); | ||
iframe.src = host.HTTP_NOTSAMESITE_ORIGIN + "/webmessaging/support/ChildWindowPostMessage.htm"; | ||
document.body.appendChild(iframe); | ||
var TARGET = document.querySelector("iframe").contentWindow; | ||
iframe.onload = t.step_func(function() { | ||
|
||
// Send a message, expecting it to be received in the iframe. | ||
channel1.port2.postMessage(1) | ||
|
||
// First, transfer the port into the same realm. | ||
channel2.port2.postMessage(0, [channel1.port1]); | ||
|
||
channel2.port1.onmessage = t.step_func(function (evt) { | ||
assert_equals(Number(evt.data), 0); | ||
|
||
t.step_timeout(function () { | ||
// Transfer the port to the iframe. | ||
TARGET.postMessage("ports", "*", evt.ports); | ||
|
||
// Keep the event-loop busy for one second, | ||
// which will result in the iframe | ||
// starting the "complete port transfer" flow, | ||
// before the window global could finish it's own. | ||
var request = new XMLHttpRequest(); | ||
request.open('GET', 'blank.html?pipe=trickle(d1)', false); | ||
request.send(null); | ||
}, 0); | ||
}); | ||
|
||
channel1.port2.onmessage = t.step_func(function (evt) { | ||
assert_equals(Number(evt.data), 1); | ||
t.done(); | ||
}); | ||
}); | ||
}, `A port transferred outside of a onmessage handler, | ||
followed by a delay in returning the buffer caused by blocking the event-loop, | ||
does not lose messages along the way.`); |
a256f2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Submitting the task to Taskcluster failed. Details
Taskcluster-GitHub attempted to create a task for this event with the following scopes:
The expansion of these scopes is not sufficient to create the task, leading to the following:
Client ID static/taskcluster/github does not have sufficient scopes and is missing the following scopes:
This request requires the client to satisfy the following scope expression: