diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/media/test/test_bug465498.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/media/test/test_bug465498.html')
-rw-r--r-- | dom/media/test/test_bug465498.html | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/dom/media/test/test_bug465498.html b/dom/media/test/test_bug465498.html new file mode 100644 index 000000000..77bc68e71 --- /dev/null +++ b/dom/media/test/test_bug465498.html @@ -0,0 +1,83 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>Media test: Bug 465498 - Seeking after playback ended</title> + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> + <script type="text/javascript" src="manifest.js"></script> +</head> +<body> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=465498">Mozilla Bug 465498</a> +<pre id="test"> +<script class="testbody" type="text/javascript"> + +var manager = new MediaTestManager; + +function startTest(e) { + var v = e.target; + info(v._name + " loadedmetadata"); + e.target.play(); +} + +function playbackEnded(e) { + var v = e.target; + info(v._name + " ended"); + if (v._finished) + return; + ok(v.currentTime >= v.duration - 0.1 && v.currentTime <= v.duration + 0.1, + "Checking currentTime at end: " + v.currentTime + " for " + v._name); + ok(v.ended, "Checking playback has ended for " + v._name); + v.pause(); + v.currentTime = 0; + ok(!v.ended, "Checking ended is no longer true for " + v._name); + v._seeked = true; +} + +function seekEnded(e) { + var v = e.target; + info(v._name + " seeked"); + if (v._finished) + return; + ok(v.currentTime == 0, "Checking currentTime after seek: " + + v.currentTime + " for " + v._name); + ok(!v.ended, "Checking ended is false for " + v._name); + v._finished = true; + removeNodeAndSource(v); + manager.finished(v.token); +} + +function seeking(e) { + var v = e.target; + info(v._name + " seeking"); +} + +function initTest(test, token) { + var type = getMajorMimeType(test.type); + var v = document.createElement(type); + if (!v.canPlayType(test.type)) + return; + v.preload = "metadata"; + v.token = token; + manager.started(token); + v._name = test.name; + + var s = document.createElement("source"); + s.type = test.type; + s.src = test.name; + v.appendChild(s); + + v._seeked = false; + v._finished = false; + v.addEventListener("loadedmetadata", startTest, false); + v.addEventListener("ended", playbackEnded, false); + v.addEventListener("seeked", seekEnded, false); + v.addEventListener("seeking", seeking, false); + document.body.appendChild(v); +} + +manager.runTests(gSmallTests, initTest); + +</script> +</pre> +</body> +</html> |