Bug 1289742. P8 - always create a video element which is capable of playing both audio and video. r?kaku
MozReview-Commit-ID: 6fSivL8rIsx
--- 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);
}