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_reactivate.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_reactivate.html')
-rw-r--r-- | dom/media/test/test_reactivate.html | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/dom/media/test/test_reactivate.html b/dom/media/test/test_reactivate.html new file mode 100644 index 000000000..fd876660c --- /dev/null +++ b/dom/media/test/test_reactivate.html @@ -0,0 +1,64 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>Test reactivation of a media element from a dead document</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> + +<iframe id="frame" src="reactivate_helper.html"></iframe> + +<pre id="test"> +<script class="testbody" type="text/javascript"> + +var elements; + +function playElement(e) { + // All elements played out, finish the test case. + if (!e) { + SimpleTest.finish(); + return; + } + + e.play(); + info("Element play: " + e._name); + var reviveElement = function() { + document.body.appendChild(e); + e.onended = function() { + info("Element ended: " + e._name); + removeNodeAndSource(e); + // Play next element. + playElement(elements.pop()); + } + } + setTimeout(reviveElement, 2000); +} + +function loadedAll(elementList) { + elements = elementList; + + // Log events for debugging. + var events = ["suspend", "play", "canplay", "canplaythrough", "loadstart", "loadedmetadata", + "loadeddata", "playing", "ended", "error", "stalled", "emptied", "abort", + "waiting", "pause"]; + function logEvent(e) { + info(e.target._name + ": got " + e.type); + } + elementList.forEach(function(element) { + events.forEach(function(evt) { + element.addEventListener(evt, logEvent, false); + }); + }); + + // Blow away the subframe + document.body.removeChild(document.getElementById("frame")); + + // Play elements one by one to avoid hitting bug 847903 on MacOSX. + playElement(elements.pop()); +} +</script> +</pre> +</body> +</html> |