Bug 1580015 - part2 : add test 'test_webvtt_infinite_processing_loop.html'. r=heycam

Differential Revision: https://phabricator.services.mozilla.com/D45567

--HG--
extra : moz-landing-system : lando
This commit is contained in:
alwu 2019-09-12 08:13:48 +00:00
Родитель 104f98fb8c
Коммит 654898b3ab
2 изменённых файлов: 50 добавлений и 0 удалений

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

@ -1229,6 +1229,8 @@ skip-if = os == 'mac' && os_version == '10.14' # mac due to bug 1545737
tags = webvtt
[test_webvtt_empty_displaystate.html]
tags = webvtt
[test_webvtt_infinite_processing_loop.html]
tags = webvtt
[test_webvtt_update_display_after_adding_or_removing_cue.html]
tags = webvtt
[test_webvtt_overlapping_time.html]

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

@ -0,0 +1,48 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Bug 1580015 - video hangs infinitely during playing subtitle</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="manifest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<style>
.container {
width: 500px;
height: 300px;
background: pink;
display: flex;
justify-content: center;
}
video {
min-width: 95%;
max-width: 95%;
max-height: 95%;
}
</style>
</head>
<body>
<div class="container">
<video id="v" src="gizmo.mp4" controls>
<track src="basic.vtt" kind="subtitles" default>
</video>
</div>
<script type="text/javascript">
/**
* This test is used to ensure that we don't go into an infinite processing loop
* during playing subtitle when setting those CSS properties on video.
*/
SimpleTest.waitForExplicitFinish();
let video = document.getElementById("v");
// We don't need to play whole video, in order to reduce test time, we can start
// from the half, which can also reproduce the issue.
video.currentTime = 3.0;
video.play();
video.onended = () => {
SimpleTest.finish();
}
</script>
</body>
</html>