Update web-platform-tests to revision dc5cbf088edcdb266541d4e5a76149a2c6e716a0

This commit is contained in:
Ms2ger 2016-09-09 09:40:35 +02:00
parent 1d40075f03
commit 079092dfea
2381 changed files with 90360 additions and 17722 deletions

View file

@ -10,9 +10,8 @@
<div id="log"></div>
<script>
function test_allowfullscreen(t, setup_iframe) {
async_test(function(t) {
var iframe = document.createElement("iframe");
setup_iframe(iframe);
iframe.src = "support/blank.htm";
var eventWatcher = new EventWatcher(t, iframe, "load");
document.body.appendChild(iframe);
@ -21,74 +20,15 @@
});
assert_true(document.fullscreenEnabled, "Top level document has fullscreen enabled flag set");
eventWatcher.wait_for("load").then(t.step_func(function() {
eventWatcher.wait_for("load").then(t.step_func_done(function() {
assert_false(iframe.contentDocument.fullscreenEnabled, "Document inside iframe without allowfullscreen attribute should not have fullscreen enabled flag set");
iframe.setAttribute("allowfullscreen", true);
assert_false(iframe.contentDocument.fullscreenEnabled, "Setting allowfullscreen attribute after document load should not affect fullscreen enabled flag");
iframe.contentWindow.location.reload();
return eventWatcher.wait_for("load");
})).then(t.step_func(function() {
assert_true(iframe.contentDocument.fullscreenEnabled, "Fullscreen enabled flag should be set when a new document is loaded with allowfullscreen attribute present");
assert_true(iframe.contentDocument.fullscreenEnabled, "Fullscreen should be allowed when allowfullscreen attribute is set");
iframe.removeAttribute("allowfullscreen");
assert_true(iframe.contentDocument.fullscreenEnabled, "Removing allowfullscreen attribute should not affect fullscreen enabled flag");
iframe.contentWindow.location.reload();
return eventWatcher.wait_for("load");
})).then(t.step_func_done(function() {
assert_false(iframe.contentDocument.fullscreenEnabled, "Fullscreen enabled flag should be reset when a new document is loaded with allowfullscreen attribute absent");
assert_false(iframe.contentDocument.fullscreenEnabled, "Fullscreen should be denied when allowfullscreen attribute is removed");
}));
}
async_test(function(t) {
test_allowfullscreen(t, function(iframe) {});
}, "iframe-allowfullscreen");
async_test(function(t) {
test_allowfullscreen(t, function(iframe) {
iframe.setAttribute("sandbox", "allow-same-origin");
});
}, "iframe-sandbox-allowfullscreen");
/* Fullscreen enabled flag with dialog */
function test_allowfullscreen_dialog(t, setup_iframe, check) {
var iframe = document.createElement("iframe");
setup_iframe(iframe);
iframe.src = "support/blank.htm";
var eventWatcher = new EventWatcher(t, iframe, "load");
document.body.appendChild(iframe);
t.add_cleanup(function() {
document.body.removeChild(iframe);
});
var newWin;
assert_true(document.fullscreenEnabled, "Top level document has fullscreen enabled flag set");
eventWatcher.wait_for("load").then(t.step_func(function() {
assert_false(iframe.contentDocument.fullscreenEnabled, "Document inside iframe without allowfullscreen attribute should not have fullscreen enabled flag set");
newWin = iframe.contentWindow.open("support/blank.htm");
t.add_cleanup(function() {
newWin.close();
});
var newWinEventWatcher = new EventWatcher(t, newWin, "load");
return newWinEventWatcher.wait_for("load");
})).then(t.step_func_done(function() {
check(newWin);
}));
}
async_test(function(t) {
test_allowfullscreen_dialog(t, function() {}, function(newWin) {
assert_true(newWin.document.fullscreenEnabled, "Document in the new window is a top level document, thus should has fullscreen enabled flag set");
});
}, "iframe-allowfullscreen-dialog");
async_test(function(t) {
test_allowfullscreen_dialog(t, function(iframe) {
iframe.setAttribute("sandbox", "allow-same-origin allow-popups");
}, function(newWin) {
assert_false(newWin.document.fullscreenEnabled, "Document in the new window should inherit the sandboxed fullscreen flag and should not have fullscreen enabled flag set");
});
}, "iframe-sandbox-allowfullscreen-dialog");
/* Fullscreen enabled flag with about:blank */
function test_allowfullscreen_noload(setup_iframe, check) {