mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update web-platform-tests to revision 9c2bea6dac36e36ba1f489d10c2be42160d8f34f
This commit is contained in:
parent
482923cec2
commit
5c371dd958
459 changed files with 10717 additions and 834 deletions
|
@ -0,0 +1,35 @@
|
|||
<!doctype html>
|
||||
<title>autoplay hidden</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/media.html#ready-states"/>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
|
||||
promise_test(async t => {
|
||||
let video = document.createElement("video");
|
||||
video.src = getVideoURI("/media/movie_5");
|
||||
video.autoplay = true;
|
||||
// In Safari and Chrome, the video needs to be muted in order to be paused when
|
||||
// hidden. They decided to do this in order to save resources when a video
|
||||
// goes out of view and isn't expected to make any sound.
|
||||
video.muted = true;
|
||||
video.loop = true;
|
||||
let watcher = new EventWatcher(t, video, ["playing", "pause"]);
|
||||
document.body.appendChild(video);
|
||||
|
||||
await watcher.wait_for("playing");
|
||||
assert_false(video.paused, "paused when video is display");
|
||||
video.hidden = true;
|
||||
|
||||
await watcher.wait_for("pause");
|
||||
assert_true(video.paused, "paused when video is hidden");
|
||||
video.hidden = false;
|
||||
|
||||
await watcher.wait_for("playing");
|
||||
assert_false(video.paused, "paused when video is display");
|
||||
}, "Allow delaying autoplay until video elements become visible");
|
||||
|
||||
</script>
|
|
@ -12,7 +12,7 @@ setup(function(){
|
|||
}, {timeout:10000, explicit_done:true});
|
||||
|
||||
onload = function() {
|
||||
(async_test(document.title)).step(function() {
|
||||
(async_test()).step(function() {
|
||||
// fail early if track isn't supported
|
||||
assert_true('HTMLTrackElement' in window, 'track not supported');
|
||||
window.corsMode = document.title.match(/^track CORS: (No CORS|Anonymous|Use Credentials)/)[1];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue