Bug 1289742. P8 - always create a video element which is capable of playing both audio and video. r?kaku draft
authorJW Wang <jwwang@mozilla.com>
Mon, 06 Mar 2017 17:14:29 +0800
changeset 493886 08e0dbff7b7ba314f51641686ee40ca904da6669
parent 493868 b60d58f0785a90463b9e0d90fa8ccadf68dd82bb
child 547962 c785329164ca2b91aaed4f16ece44825c9bba8a8
push id47883
push userjwwang@mozilla.com
push dateMon, 06 Mar 2017 09:15:16 +0000
reviewerskaku
bugs1289742
milestone54.0a1
Bug 1289742. P8 - always create a video element which is capable of playing both audio and video. r?kaku MozReview-Commit-ID: 6fSivL8rIsx
dom/media/test/test_load_same_resource.html
--- a/dom/media/test/test_load_same_resource.html
+++ b/dom/media/test/test_load_same_resource.html
@@ -66,18 +66,17 @@ function tryClone(event) {
 // This test checks that loading the same URI twice in different elements at the same time
 // uses the same resource without doing another network fetch. One of the gCloneTests
 // uses dynamic_resource.sjs to return one resource on the first fetch and a different resource
 // on the second fetch. These resources have different lengths, so if the cloned element
 // does a network fetch it will get a resource with the wrong length and we get a test
 // failure.
 
 function initTest(test, token) {
-  var elemType = /^audio/.test(test.type) ? "audio" : "video";
-  var e = document.createElement(elemType);
+  var e = document.createElement("video");
   e.preload = "auto";
   e.src = test.name;
   e._expectedDuration = test.duration;
   ok(true, `Trying to load ${test.name}, duration=${test.duration}`);
   e.addEventListener("loadeddata", tryClone, {once: true});
   e.token = token;
   manager.started(token);
 }