Update web-platform-tests to revision 60220357131c65146444da1f54624d5b54d0975d

This commit is contained in:
WPT Sync Bot 2018-07-18 15:43:58 +00:00 committed by Tom Servo
parent c45192614c
commit 775b784f79
2144 changed files with 58115 additions and 29658 deletions

View file

@ -1,3 +1,4 @@
spec: https://html.spec.whatwg.org/multipage/web-messaging.html
suggested_reviewers:
- zqzhang
- aogilvie

View file

@ -0,0 +1,12 @@
<!doctype html>
<title>resolving broken url</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
assert_throws('SYNTAX_ERR', function() {
postMessage('', [], {targetOrigin: 'http://foo bar'});
}, 'should have failed to resolve');
});
</script>

View file

@ -0,0 +1,14 @@
<!doctype html>
<title>resolving url with stuff in host-specific</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function() {
postMessage('', [], {targetOrigin: location.protocol + '//' + location.host + '//'});
onmessage = this.step_func(function(e) {
assert_equals(e.origin, location.protocol + '//' + location.host);
this.done();
});
});
</script>

View file

@ -0,0 +1,10 @@
<!doctype html>
<title>unknown parameter</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
assert_throws(new TypeError, () => postMessage('', '/', {targetOrigin: 'http://example.com'}));
});
</script>

View file

@ -0,0 +1,15 @@
<!doctype html>
<title>message channel as ports</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
async_test(function(t) {
var channel = new MessageChannel();
postMessage('', [channel.port1, channel.port2], {targetOrigin: '*'});
onmessage = t.step_func(function(e) {
assert_equals(e.ports.length, 2);
t.done();
});
}, "MessageChannel's ports as MessagePort objects");
</script>

View file

@ -0,0 +1,14 @@
<!doctype html>
<title>no targetOrigin</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function() {
postMessage('', [], {});
onmessage = this.step_func(function(e) {
assert_equals(e.data, '');
this.done();
});
});
</script>

View file

@ -0,0 +1,10 @@
<!doctype html>
<title>null arg two interpreted as null string</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));
});
</script>

View file

@ -0,0 +1,14 @@
<!doctype html>
<title>just one argument</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
postMessage('');
onmessage = this.step_func(function(e) {
assert_equals(e.data, '');
this.done();
});
});
</script>

View file

@ -0,0 +1,14 @@
<!doctype html>
<title>special value '/'</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function() {
postMessage('', [], {targetOrigin: '/'});
onmessage = this.step_func(function(e) {
assert_equals(e.data, '');
this.done();
});
});
</script>

View file

@ -0,0 +1,14 @@
<!doctype html>
<title>two argument</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
postMessage('', []);
onmessage = this.step_func(function(e) {
assert_equals(e.data, '');
this.done();
});
});
</script>

View file

@ -0,0 +1,14 @@
<!doctype html>
<title>undefined as transferable</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
async_test(function() {
postMessage('', undefined);
onmessage = this.step_func(function(e) {
assert_array_equals(e.ports, []);
this.done();
});
});
</script>

View file

@ -0,0 +1,14 @@
<!doctype html>
<title>unknown parameter</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function() {
postMessage('', [], {someBogusParameterOnThisDictionary: 'food'});
onmessage = this.step_func(function(e) {
assert_equals(e.data, '');
this.done();
});
});
</script>