Update web-platform-tests to revision 5e377e222095625488698633a435d6c19e4d611d

This commit is contained in:
WPT Sync Bot 2018-03-10 20:09:24 -05:00
parent 53d9ca1bcd
commit 53868fcf1b
18 changed files with 265 additions and 38 deletions

View file

@ -42,13 +42,23 @@
window.onmessage = t.step_func(function(e)
{
// testharness.js uses postMessage so we must check what data we want to receive
if (e.data.toString() === "#1" || e.data.toString() === "#2") {
ActualResult.push(e.data, e.origin);
if (ActualResult.length === ExpectedResult.length) {
assert_array_equals(ActualResult, ExpectedResult, "ActualResult");
t.done();
}
// Messages from TARGET1 and TARGET2 can come in any order
// (since one of them is cross-origin and can run in parallel).
// To make the tests immune to message reordering, always
// put the response from TARGET1 at the start of the list.
if (e.data.toString() === "#1")
{
ActualResult = [e.data, e.origin].concat(ActualResult);
}
else if (e.data.toString() === "#2")
{
ActualResult = ActualResult.concat([e.data, e.origin]);
}
if (ActualResult.length >= ExpectedResult.length)
{
assert_array_equals(ActualResult, ExpectedResult, "ActualResult");
t.done();
}
});
</script>

View file

@ -42,7 +42,18 @@
window.onmessage = t.step_func(function(e)
{
ActualResult.push(e.data, e.origin);
// Messages from TARGET1 and TARGET2 can come in any order
// (since one of them is cross-origin and can run in parallel).
// To make the tests immune to message reordering, always
// put the response from TARGET1 at the start of the list.
if (e.data.toString() === "#1")
{
ActualResult = [e.data, e.origin].concat(ActualResult);
}
else if (e.data.toString() === "#2")
{
ActualResult = ActualResult.concat([e.data, e.origin]);
}
if (ActualResult.length >= ExpectedResult.length)
{