Bug 1509422 [wpt PR 14194] - Fix two fullscreen wpt tests for UAv2., a=testonly

Automatic update from web-platform-tests
Fix two fullscreen wpt tests for UAv2.

Also marks one currently untestable test.

Bug: 906791
Change-Id: I17fd03f16e93244be80f9572db8c43e8e0b95678
Reviewed-on: https://chromium-review.googlesource.com/c/1347092
Commit-Queue: Mustaq Ahmed <mustaq@chromium.org>
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610651}

--

wpt-commits: 1700cffc1ede02465c9aca38d06cbad9d634a920
wpt-pr: 14194
This commit is contained in:
Mustaq Ahmed 2018-11-30 18:01:12 +00:00 коммит произвёл moz-wptsync-bot
Родитель 06c6d59fd9
Коммит 3a9770dc26
3 изменённых файлов: 47 добавлений и 8 удалений

Просмотреть файл

@ -26,7 +26,9 @@ async_test((t) => {
elem.addEventListener('load', () => {
trusted_click(t, () => {
elem.contentWindow.postMessage({"action": "report"}, "*");
}, document.body);
}, elem.contentDocument.body);
// TODO(mustaq): The click above should activate the subframe. But
// elem.contentDocument is inaccessible (null) from a cross origin parent!
});
});
</script>

Просмотреть файл

@ -0,0 +1,29 @@
<!DOCTYPE html>
<!--
Tentative, due to:
https://github.com/whatwg/html/issues/1903
Once the issue is resolved, this test would replace the corresponding
non-tentative test (element-ready-check-containing-iframe-manual.html)
-->
<title>Element ready check for containing iframe</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../trusted-click.js"></script>
<div id="log"></div>
<iframe allowfullscreen></iframe>
<iframe allowfullscreen></iframe>
<script>
// wait for load event to avoid https://bugzil.la/1493878
window.onload = function() {
async_test(function(t) {
var iframes = document.getElementsByTagName("iframe");
trusted_request(t, iframes[0].contentDocument.body, iframes[0].contentDocument.body);
iframes[0].contentDocument.onfullscreenchange = t.step_func(function() {
assert_equals(document.fullscreenElement, iframes[0]);
trusted_request(t, iframes[1].contentDocument.body, iframes[0].contentDocument.body);
iframes[1].contentDocument.onfullscreenchange = t.unreached_func("fullscreenchange event");
iframes[1].contentDocument.onfullscreenerror = t.step_func_done();
});
});
};
</script>

Просмотреть файл

@ -21,19 +21,27 @@ async_test(t => {
assert_in_array(document.fullscreenElement, [a, b]);
order.push(document.fullscreenElement.id);
if (order.length == 2) {
// Since fullscreenchange event occurs at animation frame timing we might
// have not seen the transition from null -> 'b' but just see the
// resulting 'a' transition twice.
// When the second event arrived, the fullscreen element may still be the
// old one.
//
// TODO(mustaq): We need a better explanation here to cover the tree-order
// idea of the spec.
assert_true(order[0] == 'a' || order[0] == 'b', 'first id seen is a or b');
assert_true(order[1] == 'a', 'second id seen is b');
assert_true(order[1] == 'a', 'second id seen is a');
t.done();
}
});
document.onfullscreenerror = t.unreached_func('fullscreenerror event');
// Make a trusted click on frame 'b' to activate it.
trusted_click(t, () => {
b.contentDocument.body.requestFullscreen();
a.contentDocument.body.requestFullscreen();
}, document.body);
// Now queue a trusted click on frame 'a' to make back-to-back calls.
setTimeout(() => {
trusted_click(t, () => {
b.contentDocument.body.requestFullscreen();
a.contentDocument.body.requestFullscreen();
}, a.contentDocument.body);
}, 0);
}, b.contentDocument.body);
});
</script>