Bug 1021676 - Fix and re-enable test_delay_load.html on B2G. r=cajbir
authorJW Wang <jwwang@mozilla.com>
Tue, 14 Oct 2014 19:47:00 -0400
changeset 210744 75e03e9d1c315c1acf4b696fbacf48a665f5f026
parent 210743 0e462b14ae1a3968ae837e8bf4ab07a9f48e0e7a
child 210745 a5108055f652d02f1d10fdb29a44d2f56b2dbf3e
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerscajbir
bugs1021676
milestone36.0a1
Bug 1021676 - Fix and re-enable test_delay_load.html on B2G. r=cajbir
content/media/test/mochitest.ini
content/media/test/test_delay_load.html
--- a/content/media/test/mochitest.ini
+++ b/content/media/test/mochitest.ini
@@ -297,17 +297,17 @@ support-files =
   wave_metadata_utf8.wav
   wave_metadata_utf8.wav^headers^
   wavedata_s16.wav
   wavedata_s16.wav^headers^
   wavedata_u8.wav
   wavedata_u8.wav^headers^
 
 [test_access_control.html]
-skip-if = buildapp == 'b2g' && toolkit != 'gonk' # crash on b2g-desktop
+skip-if = buildapp == 'b2g' && toolkit != 'gonk' # bug 1082984
 [test_aspectratio_mp4.html]
 [test_audio1.html]
 [test_audio2.html]
 [test_audioDocumentTitle.html]
 skip-if = true # bug 475110 - disabled since we don't play Wave files standalone
 [test_autoplay.html]
 [test_autoplay_contentEditable.html]
 [test_buffered.html]
@@ -346,17 +346,17 @@ skip-if = toolkit == 'gonk' && debug
 [test_contentDuration6.html]
 [test_contentDuration7.html]
 [test_controls.html]
 [test_currentTime.html]
 [test_decode_error.html]
 [test_decoder_disable.html]
 [test_defaultMuted.html]
 [test_delay_load.html]
-skip-if = buildapp == 'b2g' # bug 1021676
+skip-if = buildapp == 'b2g' && toolkit != 'gonk' # bug 1082984
 [test_encryptedMediaExtensions.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # bug 1043403, bug 1057908
 [test_error_in_video_document.html]
 skip-if = toolkit == 'android' # bug 608634
 [test_error_on_404.html]
 [test_fastSeek.html]
 [test_fastSeek-forwards.html]
 [test_imagecapture.html]
--- a/content/media/test/test_delay_load.html
+++ b/content/media/test/test_delay_load.html
@@ -4,71 +4,58 @@
 https://bugzilla.mozilla.org/show_bug.cgi?id=479711
 -->
 <head>
   <title>Test for Bug 479711</title>
   <script type="application/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>
   <script>
-  
+
   var gRegisteredElements = [];
-  var gLog = false;
   var testWindows = [];
 
-  function log(msg) {
-    if (gLog) {
-      document.getElementById('log').innerHTML += "<p>"+msg+"</p>";
-      dump(msg + "\n");
-    }
-  }
-  
   function register(v) {
     gRegisteredElements.push(v);
   }
 
   function loaded() {
-    log("onload fired!");
+    info("onload fired!");
 
     for (var i = 0; i < gRegisteredElements.length; ++i) {
       var v = gRegisteredElements[i];
       ok(v.readyState >= v.HAVE_CURRENT_DATA,
          v._name + ":" + v.id + " is not ready before onload fired (" + v.readyState + ")");
     }
 
     for (i=0; i<testWindows.length; ++i) {
       testWindows[i].close();
     }
 
-    mediaTestCleanup();    
+    mediaTestCleanup();
 
     SimpleTest.finish();
   }
-  
+
   addLoadEvent(loaded);
-  
 
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=479711">Mozilla Bug 479711</a>
 <p id="display"></p>
-<div id="content" style="display: none">
-  
-</div>
-
-
-<div id="log" style="font-size: small;"></div>
+<div id="content" style="display: none"></div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 479711 **/
 
 function createVideo(name, type, id) {
   var v = document.createElement("video");
+  v.preload = "metadata";
   // Make sure each video is a unique resource
   v.src = name + "?" + id;
   v._name = name;
   v.id = id;
   register(v);
   return v;
 }
 
@@ -77,17 +64,17 @@ var test = getPlayableVideo(gSmallTests)
 // Straightforward add, causing a load.
 var v = createVideo(test.name, test.type, "1");
 document.body.appendChild(v);
 
 // Load, add, then remove.
 v = createVideo(test.name, test.type, "1");
 v.load();
 document.body.appendChild(v);
-v.parentNode.removeChild(v);
+v.remove();
 
 // Load and add.
 v = createVideo(test.name, test.type, "2");
 v.load();
 document.body.appendChild(v);
 
 // Load outside of doc.
 v = createVideo(test.name, test.type, "3");