Update web-platform-tests to revision 7a767a52741f628430ffbbed46e7f3df68ba3534

Fixes #15648.
This commit is contained in:
Ms2ger 2017-02-20 11:44:42 +01:00
parent a1e4c547f0
commit 4fadf9b0b6
1184 changed files with 22551 additions and 9856 deletions

View file

@ -0,0 +1,54 @@
<!doctype html>
<meta charset=utf-8>
<title></title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<iframe id="existing" src="resources/post-your-protocol.html?existing"></iframe>
<iframe id="http-and-gunk" src="resources/post-your-protocol.html?http-and-gunk"></iframe>
<iframe id="https-and-gunk" src="resources/post-your-protocol.html?https-and-gunk"></iframe>
<script>
// NOTE: we do not listen to message events until our load event fires, so we
// only get them for the things we actually care about.
var wrapper_test = async_test("General setup");
var tests = {
"existing": { test: async_test("Set location.protocol = location.protocol"),
result: location.protocol },
"http-and-gunk": { test: async_test("Set location.protocol to http:gunk"),
result: "http:" },
// We should really test the "https:gunk" case too, and assert that it ends up
// with a protocol of "https:", but can't. See comments below for why.
};
function messageListener(e) {
test(function() {
var data = e.data;
var id = data.id;
var t = tests[id].test;
t.step(function() {
assert_equals(data.protocol, tests[id].result, "Protocol should match");
})
t.done();
}, "Message listener");
}
addEventListener("load", wrapper_test.step_func_done(function() {
addEventListener("message", messageListener);
tests["existing"].test.step(function() {
var loc = document.getElementById("existing").contentWindow.location;
loc.protocol = loc.protocol;
});
tests["http-and-gunk"].test.step(function() {
var loc = document.getElementById("http-and-gunk").contentWindow.location;
loc.protocol = "http:gunk";
});
// I wish we could test the https bit, but can't figure out a non-racy way to
// do it, because we need to change both protocol (to https) _and_ port to
// {{ports[https][0]}} to get a successful load unless we're running on the
// default http port, but the setter uses the current value, which doesn't get
// updated sync, as the url to start with for the set. Oh, and there's no
// good way to detect when the port set is "done" either.
}));
</script>

View file

@ -8,4 +8,17 @@
<div id=log></div>
<script>
test_stringifier_attribute(location, "href", true);
test(function() {
const prop1 = Object.getOwnPropertyDescriptor(location, "toString"),
prop2 = Object.getOwnPropertyDescriptor(location, "href")
assert_true(prop1.enumerable)
assert_false(prop1.writable)
assert_false(prop1.configurable)
assert_true(prop2.enumerable)
assert_false(prop2.configurable)
assert_equals(typeof prop2.get, "function")
})
</script>

View file

@ -0,0 +1,14 @@
<!DOCTYPE html>
<title>Location Symbol.toPrimitive</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<script>
test(() => {
assert_equals(location[Symbol.toPrimitive], undefined)
const prop = Object.getOwnPropertyDescriptor(location, Symbol.toPrimitive)
assert_false(prop.enumerable)
assert_false(prop.writable)
assert_false(prop.configurable)
})
</script>

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<title>Location has no toJSON</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<script>
test(() => {
assert_equals(location.toJSON, undefined)
assert_equals(Object.getOwnPropertyDescriptor(location, "toJSON"), undefined)
assert_false(location.hasOwnProperty("toJSON"))
})
</script>
<!-- See https://github.com/whatwg/html/pull/2294 for context. (And the HTML Standard of course.) -->

View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<title>Location valueOf</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<script>
test(() => {
assert_equals(location.valueOf, Object.prototype.valueOf)
assert_equals(typeof location.valueOf.call(5), "object")
const prop = Object.getOwnPropertyDescriptor(location, "valueOf")
assert_false(prop.enumerable)
assert_false(prop.writable)
assert_false(prop.configurable)
})
</script>

View file

@ -0,0 +1,4 @@
<script>
var id = location.search.substring(1);
parent.postMessage({ id: id, protocol: location.protocol }, "*");
</script>