Update web-platform-tests to revision 81962ac8802223d038b188b6f9cb88a0a9c5beee

This commit is contained in:
WPT Sync Bot 2018-05-18 22:02:29 -04:00
parent fe1a057bd1
commit 24183668c4
1960 changed files with 29853 additions and 10555 deletions

View file

@ -0,0 +1 @@
See `/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html` for more detailed parsing tests (shared with `<meta http-equiv=refresh>`).

View file

@ -0,0 +1,23 @@
async_test(t => {
const frame = document.createElement("iframe");
frame.src = "resources/refresh.py"
frame.onload = t.step_func(() => {
// Could be better by verifying that resources/refresh.py loads too
if(frame.contentWindow.location.href === (new URL("resources/refreshed.txt?\u0080\u00FF", self.location)).href) { // Make sure bytes got mapped to code points of the same value
t.done();
}
});
document.body.appendChild(frame)
}, "When navigating the Refresh header needs to be followed");
async_test(t => {
const frame = document.createElement("iframe");
frame.src = "resources/multiple.asis"
frame.onload = t.step_func(() => {
// Could be better by verifying that resources/refresh.py loads too
if(frame.contentWindow.location.href === (new URL("resources/refreshed.txt", self.location)).href) {
t.done();
}
});
document.body.appendChild(frame)
}, "When there's both a Refresh header and <meta> the Refresh header wins")

View file

@ -0,0 +1,6 @@
HTTP/1.1 200 OK
Refresh: 0,./refreshed.txt
Content-Type:text/html
I don't understand.
<meta http-equiv=refresh content=1;./>

View file

@ -0,0 +1,4 @@
def main(request, response):
response.headers.set("Content-Type", "text/plain")
response.headers.set("Refresh", "0;./refreshed.txt?\x80\xFF") # Test byte to Unicode conversion
response.content = "Not refreshed.\n"

View file

@ -0,0 +1,6 @@
promise_test(() => {
return fetch("resources/refresh.py").then(response => {
assert_equals(response.headers.get("refresh"), "0;./refreshed.txt?\u0080\u00FF"); // Make sure bytes got mapped to code points of the same value
assert_equals(response.url, (new URL("resources/refresh.py", self.location)).href);
});
}, "Refresh does not affect subresources.");

View file

@ -0,0 +1,24 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>History pushState sets the url</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id="log"></div>
<script>
async_test(function(t) {
var oldLocation = window.location.toString();
window.history.pushState(null, "", "#hash");
assert_equals(oldLocation + "#hash", window.location.toString(), "pushState updates url");
history.back();
window.onhashchange = () => {
assert_equals(oldLocation, window.location.toString(), 'history traversal restores old url');
t.done();
};
}, "history pushState sets url");
</script>
</body>
</html>

View file

@ -20,16 +20,7 @@
assert_throws("SecurityError", function () {
var couldAccessCrossOriginProperty = e.source.location.href;
}, "The 'data:' frame should be cross-origin: 'window.location.href'");
// Try to access contentDocument of the 'data: ' frame. Some browsers
// (i.e. Firefox, Safari) will return |null| and some (i.e. Chrome)
// will throw an exception.
var dataFrameContentDocument = null;
try {
dataFrameContentDocument = i.contentDocument;
} catch (ex) {
}
assert_equals(dataFrameContentDocument, null, "The 'data:' iframe should be unable to access its contentDocument.");
assert_equals(i.contentDocument, null, "The 'data:' iframe should be unable to access its contentDocument.");
}));
document.body.appendChild(i);

View file

@ -15,7 +15,7 @@
var SUFFIX_HOST = ORIGINAL_HOST.substring(ORIGINAL_HOST.lastIndexOf('.') + 1); // e.g. "test"
var PREFIX_HOST = "www1." + ORIGINAL_HOST; // e.g. "www1.web-platform.test"
var iframe = document.getElementById("iframe");
var iframe_url = new URL("document_domain_setter_iframe.html", document.location);
var iframe_url = new URL("support/document_domain_setter_iframe.html", document.location);
iframe_url.hostname = PREFIX_HOST;
iframe.src = iframe_url;
test(function() {
@ -25,11 +25,11 @@
assert_throws("SecurityError", function() { document.domain = "example.com"; });
}, "failed setting of document.domain");
async_test(function(t) {
iframe.addEventListener("load", t.step_func(function() {
iframe.addEventListener("load", t.step_func_done(function() {
// Before setting document.domain, the iframe is not
// same-origin-domain, so security checks fail.
assert_equals(iframe.contentDocument, null);
assert_equals(iframe.contentWindow.frameElement, null);
assert_throws("SecurityError", () => iframe.contentWindow.frameElement);
assert_throws("SecurityError", function() { iframe.contentWindow.location.origin; });
assert_throws("SecurityError", function() { iframe.contentWindow.location.href; });
assert_throws("SecurityError", function() { iframe.contentWindow.location.protocol; });
@ -45,8 +45,8 @@
// After setting document.domain, the iframe is
// same-origin-domain, so security checks pass.
assert_equals(iframe.contentDocument.domain, document.domain);
assert_equals(iframe.contentWindow.frameElement, iframe)
assert_equals(iframe.contentWindow.origin, window.origin);
assert_equals(iframe.contentWindow.frameElement, iframe);
assert_equals(iframe.contentWindow.origin, iframe_url.origin);
assert_equals(iframe.contentWindow.location.href, iframe_url.href);
assert_equals(iframe.contentWindow.location.protocol, iframe_url.protocol);
assert_equals(iframe.contentWindow.location.host, iframe_url.host);
@ -60,7 +60,6 @@
// document.open checks for same-origin, not same-origin-domain,
// https://github.com/whatwg/html/issues/2282
assert_throws("SecurityError", function() { iframe.contentDocument.open(); });
t.done();
}));
}, "same-origin-domain iframe");
</script>