Bug 1289742. P2 - remove the e.canPlayType() test which is already done by MediaTestManager. r?kaku draft
authorJW Wang <jwwang@mozilla.com>
Mon, 06 Mar 2017 14:59:30 +0800
changeset 493863 a35e8496af04135f8d24fc5868e34ede678aa6de
parent 493862 6fcafdc9626221cf9f6418c7e8029c5688176ee2
child 493864 f9d3feba171b65b5f92b4d1b54d56548f742b6e7
push id47870
push userjwwang@mozilla.com
push dateMon, 06 Mar 2017 07:41:53 +0000
reviewerskaku
bugs1289742
milestone54.0a1
Bug 1289742. P2 - remove the e.canPlayType() test which is already done by MediaTestManager. r?kaku MozReview-Commit-ID: 7Pe8CyHgmzB
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
@@ -74,27 +74,25 @@ function tryClone(event) {
 // 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);
   e.preload = "auto";
-  if (e.canPlayType(test.type)) {
-    e.src = test.name;
-    if (test.duration) {
-      e._expectedDuration = test.duration;
-    }
-    ok(true, "Trying to load " + test.name);
-    e.addEventListener("loadeddata", tryClone);
-    e.load();
-    e.token = token;
-    manager.started(token);
+  e.src = test.name;
+  if (test.duration) {
+    e._expectedDuration = test.duration;
   }
+  ok(true, "Trying to load " + test.name);
+  e.addEventListener("loadeddata", tryClone);
+  e.load();
+  e.token = token;
+  manager.started(token);
 }
 
 manager.runTests(gCloneTests, initTest);
 
 </script>
 </pre>
 </body>
 </html>