Update web-platform-tests to revision be5419e845d39089ba6dc338c1bd0fa279108317

This commit is contained in:
Josh Matthews 2018-01-04 13:44:24 -05:00
parent aa199307c8
commit 2b6f573eb5
3440 changed files with 109438 additions and 41750 deletions

View file

@ -10,6 +10,11 @@ test(function () {
'There should be no PopStateEvent#initPopStateEvent');
}, 'initPopStateEvent');
test(function () {
var popStateEvent = new PopStateEvent("popstate");
assert_equals(popStateEvent.state, null, "the PopStateEvent.state");
}, "Initial value of PopStateEvent.state must be null");
test(function () {
var state = history.state;
var data;

View file

@ -18,6 +18,12 @@ window.onload = t.step_func(function () {
location.hash = 'foo';
window.onhashchange = t.step_func(function (e) {
assert_true(e.isTrusted);
assert_equals(e.target, window);
assert_equals(e.type, "hashchange");
assert_true(e instanceof HashChangeEvent);
assert_true(e.bubbles, "bubble");
assert_false(e.cancelable, "cancelable");
oldURLs.push(e.oldURL);
newURLs.push(e.newURL);
if (newURLs.length === 2) {

View file

@ -1,20 +1,18 @@
<!DOCTYPE html>
<meta name=timeout content=long>
<title>Precedence of scroll restoration mode over fragment scrolling in cross-origin history traversal</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<style>
iframe {
height: 300px;
width: 300px;
}
</style>
<body>
<iframe></iframe>
</body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script type="text/javascript">
<div id="log"></div>
<iframe></iframe>
<script>
'use strict';
// The test does the following navigation steps for iframe
@ -23,13 +21,16 @@
// 3. go back to page-with-fragment.html
async_test(function(t) {
var iframe = document.querySelector('iframe');
var baseURL = location.href.substring(0, location.href.lastIndexOf('/'));
var hostInfo = get_host_info();
var basePath = location.pathname.substring(0, location.pathname.lastIndexOf('/'));
var localURL = hostInfo.HTTP_ORIGIN + basePath + '/resources/page-with-fragment.html#fragment';
var remoteURL = hostInfo.HTTP_REMOTE_ORIGIN + basePath + "/resources/blank1.html"
var steps = [
function() {
iframe.src = 'resources/page-with-fragment.html#fragment';
}, function() {
assert_equals(iframe.contentWindow.location.href, baseURL + '/resources/page-with-fragment.html#fragment', 'should be on page-with-fragment page');
assert_equals(iframe.contentWindow.location.href, localURL, 'should be on page-with-fragment page');
// wait one animation frame to ensure layout is run and fragment scrolling is complete
iframe.contentWindow.requestAnimationFrame(function() {
assert_equals(iframe.contentWindow.scrollY, 800, 'should scroll to fragment');
@ -40,13 +41,13 @@
});
}, function() {
// navigate to a new page from a different origin
iframe.src = iframe.src.replace("http://", "http://www.").replace("page-with-fragment.html#fragment", "blank1.html");
iframe.src = remoteURL;
}, function() {
// going back causes the iframe to traverse back
history.back();
}, function() {
// coming back from history, scrollRestoration should be set to manual and respected
assert_equals(iframe.contentWindow.location.href, baseURL + '/resources/page-with-fragment.html#fragment', 'should be back on page-with-fragment page');
assert_equals(iframe.contentWindow.location.href, localURL, 'should be back on page-with-fragment page');
iframe.contentWindow.requestAnimationFrame(t.step_func_done(function() {
assert_equals(iframe.contentWindow.history.scrollRestoration, 'manual', 'navigating back should retain scrollRestoration value');
assert_equals(iframe.contentWindow.scrollX, 0, 'should not scroll to fragment');

View file

@ -1,30 +1,27 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Media documents: video</title>
<link rel="author" title="Michael Ventnor" href="mailto:mventnor@mozilla.com">
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#read-media">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta charset="utf-8">
<title>Media documents: video</title>
<link rel="author" title="Michael Ventnor" href="mailto:mventnor@mozilla.com">
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#read-media">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/media.js"></script>
<div id="log"></div>
<script>
var t = async_test("The document for a standalone media file should have one child in the body.");
function frameLoaded() {
var testframe = document.getElementById('testframe');
assert_equals(testframe.contentDocument.contentType, "video/webm");
async_test(function() {
var testframe = document.createElement('iframe');
var url = getVideoURI("/media/A4");
var contentType = getMediaContentType(url);
testframe.onload = this.step_func_done(function() {
assert_equals(testframe.contentDocument.contentType, contentType);
var testframeChildren = testframe.contentDocument.body.childNodes;
assert_equals(testframeChildren.length, 1, "Body of image document has 1 child");
assert_equals(testframeChildren[0].nodeName, "VIDEO", "Only child of body must be an <video> element");
assert_equals(testframeChildren[0].namespaceURI, "http://www.w3.org/1999/xhtml",
"Only child of body must be an HTML element");
t.done();
}
});
testframe.src = url;
document.body.appendChild(testframe);
}, "The document for a standalone media file should have one child in the body.");
</script>
</head>
<body>
<div id="log"></div>
<iframe id="testframe" onload="t.step(frameLoaded)" src="/media/white.webm"></iframe>
</body>
</html>