Bug 896582 - Implement a workaround to bug 838726 to get a bunch of content/media mochitests running on B2G. r=jgriffin
authorMartijn Wargers <mwargers@mozilla.com>
Thu, 25 Jul 2013 22:32:17 +0200
changeset 152404 740efbc3485a87b9c873941ffd8651f5726eddad
parent 152403 f2862e93b71017234ca2217cbe28d2d40b940eff
child 152405 3ccb29418bfcd368e75d5ffc4480a8034d190f60
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgriffin
bugs896582, 838726
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 896582 - Implement a workaround to bug 838726 to get a bunch of content/media mochitests running on B2G. r=jgriffin
content/media/test/file_access_controls.html
content/media/test/manifest.js
testing/mochitest/b2g.json
--- a/content/media/test/file_access_controls.html
+++ b/content/media/test/file_access_controls.html
@@ -144,17 +144,15 @@ function nextTest() {
     // Will cause load() to be invoked.
   } else {
     gVideo.load();
   }
   gTestNum++;
 }
 
 function done() {
-  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-  mediaTestCleanup();
   opener.done();
 }
 
 </script>
 </body>
 </html>
 
--- a/content/media/test/manifest.js
+++ b/content/media/test/manifest.js
@@ -211,17 +211,17 @@ var gInvalidTests = [
   { name:"invalid-cmap-s1c2.opus", type:"audio/ogg; codecs=opus"},
 ];
 
 // Converts a path/filename to a file:// URI which we can load from disk.
 // Optionally checks whether the file actually exists on disk at the location
 // we've specified.
 function fileUriToSrc(path, mustExist) {
   // android mochitest doesn't support file://
-  if (navigator.appVersion.indexOf("Android") != -1)
+  if (navigator.appVersion.indexOf("Android") != -1 || SpecialPowers.Services.appinfo.name == "B2G")
     return path;
 
   const Ci = SpecialPowers.Ci;
   const Cc = SpecialPowers.Cc;
   const Cr = SpecialPowers.Cr;
   var dirSvc = Cc["@mozilla.org/file/directory_service;1"].
                getService(Ci.nsIProperties);
   var f = dirSvc.get("CurWorkD", Ci.nsILocalFile);
@@ -686,30 +686,30 @@ function mediaTestCleanup() {
                                  .classes["@mozilla.org/preferences-service;1"]
                                  .getService(SpecialPowers.Ci.nsIPrefService);
   var branch = prefService.getBranch("media.");
   var oldDefault = 2;
   var oldAuto = 3;
   var oldGStreamer = undefined;
   var oldOpus = undefined;
 
-  try { oldGStreamer = branch.getBoolPref("gstreamer.enabled"); } catch(ex) { }
-  try { oldDefault   = branch.getIntPref("preload.default"); } catch(ex) { }
-  try { oldAuto      = branch.getIntPref("preload.auto"); } catch(ex) { }
-  try { oldOpus      = branch.getBoolPref("opus.enabled"); } catch(ex) { }
+  try { oldGStreamer = SpecialPowers.getBoolPref("media.gstreamer.enabled"); } catch(ex) { }
+  try { oldDefault   = SpecialPowers.getIntPref("media.preload.default"); } catch(ex) { }
+  try { oldAuto      = SpecialPowers.getIntPref("media.preload.auto"); } catch(ex) { }
+  try { oldOpus      = SpecialPowers.getBoolPref("media.opus.enabled"); } catch(ex) { }
 
-  branch.setIntPref("preload.default", 2); // preload_metadata
-  branch.setIntPref("preload.auto", 3); // preload_enough
+  SpecialPowers.setIntPref("media.preload.default", 2); // preload_metadata
+  SpecialPowers.setIntPref("media.preload.auto", 3); // preload_enough
   // test opus playback iff the pref exists
   if (oldOpus !== undefined)
-    branch.setBoolPref("opus.enabled", true);
+    SpecialPowers.setBoolPref("media.opus.enabled", true);
   if (oldGStreamer !== undefined)
-    branch.setBoolPref("gstreamer.enabled", true);
+    SpecialPowers.setBoolPref("media.gstreamer.enabled", true);
 
   window.addEventListener("unload", function() {
     if (oldGStreamer !== undefined)
-      branch.setBoolPref("gstreamer.enabled", oldGStreamer);
-    branch.setIntPref("preload.default", oldDefault);
-    branch.setIntPref("preload.auto", oldAuto);
+      SpecialPowers.setBoolPref("media.gstreamer.enabled", oldGStreamer);
+    SpecialPowers.setIntPref("media.preload.default", oldDefault);
+    SpecialPowers.setIntPref("media.preload.auto", oldAuto);
     if (oldOpus !== undefined)
-      branch.setBoolPref("opus.enabled", oldOpus);
+      SpecialPowers.setBoolPref("media.opus.enabled", oldOpus);
   }, false);
  })();
--- a/testing/mochitest/b2g.json
+++ b/testing/mochitest/b2g.json
@@ -4,17 +4,81 @@
     "content": "",
     "docshell": "",
     "dom": "",
     "layout": ""
   },
 "excludetests": {
     "content/xbl/":"",
     "content/xul":"",
-    "content/media/":"",
+
+    "content/media/test/test_bug448534.html": "",
+    "content/media/test/test_bug495300.html":"",
+    "content/media/test/test_bug495300.html":"",
+    "content/media/test/test_bug463162.xhtml":"",
+    "content/media/test/test_bug495145.html": "timed out",
+    "content/media/test/test_bug686942.html": "timed out",
+    "content/media/test/test_bug686137.html": "TIMED_OUT",
+    "content/media/test/test_can_play_type.html":"timed out",
+    "content/media/test/test_chaining.html": "timed out",
+    "content/media/test/test_contentDuration1.html": "TIMED_OUT",
+    "content/media/test/test_contentDuration2.html": "TIMED_OUT",
+    "content/media/test/test_contentDuration3.html": "TIMED_OUT",
+    "content/media/test/test_contentDuration4.html": "TIMED_OUT",
+    "content/media/test/test_contentDuration5.html": "TIMED_OUT",
+    "content/media/test/test_contentDuration6.html": "TIMED_OUT",
+    "content/media/test/test_contentDuration7.html": "timed out",
+    "content/media/test/test_decoder_disable.html":"timed out",
+    "content/media/test/test_error_on_404.html": "timed out",
+    "content/media/test/test_fragment_noplay.html": "timed out",
+    "content/media/test/test_fragment_play.html": "",
+    "content/media/test/test_load.html": "Timed out after gizmo.mp4",
+    "content/media/test/test_load_candidates.html": "timed out",
+    "content/media/test/test_load_same_resource.html": "",
+    "content/media/test/test_media_selection.html": "",
+    "content/media/test/test_metadata.html": "",
+    "content/media/test/test_mozHasAudio.html": "",
+    "content/media/test/test_playback_rate_playpause.html": "",
+    "content/media/test/test_reactivate.html": "timed out in small-shot.mp3",
+    "content/media/test/test_referer.html":"",
+    "content/media/test/test_replay_metadata.html": "",
+    "content/media/test/test_seekable1.html": "",
+    "content/media/test/test_seek_out_of_range.html": "",
+    "content/media/test/test_seekLies.html": "",
+    "content/media/test/test_wave_data_s16.html": "",
+    "content/media/test/test_source.html": "",
+    "content/media/test/test_source_media.html": "",
+    "content/media/test/test_wave_data_u8.html": "",
+
+    "content/media/mediasource/test/test_MediaSource.html": " ReferenceError: MediaSource is not defined",
+    "content/media/test/test_bug654550.html": "timed out",
+    "content/media/test/test_delay_load.html": "6 failures",
+    "content/media/test/test_info_leak.html": "2 failures",
+    "content/media/test/test_play_events.html": "Last event should be canplaythrough for gizmo.mp4 - got playing, expected canplaythrough",
+    "content/media/test/test_play_events_2.html": "Last event should be canplaythrough for gizmo.mp4 - got playing, expected canplaythrough",
+    "content/media/test/test_playback.html": "Test timed out",
+    "content/media/test/test_play_events.html": "Last event should be canplaythrough for gizmo.mp4 - got playing, expected canplaythrough",
+    "content/media/test/test_play_events_2.html": "Last event should be canplaythrough for gizmo.mp4 - got playing, expected canplaythrough",
+    "content/media/test/test_playback.html": "Test timed out",
+    "content/media/test/test_streams_gc.html": "Value being assigned to HTMLMediaElement.currentTime is not a finite floating-point value",
+    "content/media/webaudio/test/test_audioBufferSourceNodeNeutered.html": "Test timed out",
+    "content/media/webaudio/test/test_audioBufferSourceNodeNeutered.html": " Test timed out",
+    "content/media/webspeech/recognition/test/test_nested_eventloop.html": "NS_ERROR_NOT_AVAILABLE: [nsIDOMWindow.showModalDialog]",
+    "content/media/webspeech/synth/ipc/test/test_ipc.html": "comp.classes['@mozilla.org/special-powers-observer;1'] is undefined",
+    "content/media/webspeech/synth/test/test_speech_queue.html": "Test timed out",
+    "content/media/webspeech/synth/test/test_speech_simple.html": "Test timed out",
+    "content/media/test/test_framebuffer.html": "timed out",
+    "content/media/test/test_seekable2.html": "timed out",
+    "content/media/test/test_seekable3.html": "timed out",
+    "content/media/webspeech/recognition/test/test_recognition_service_error.html": "timed out",
+    "content/media/test/test_can_play_type_mpeg.html":"7 failures out of 27",
+    "content/media/test/test_unseekable.html":"",
+    "content/media/webaudio/test/test_audioBufferSourceNodeOffset.html":"",
+    "content/media/test/test_can_play_type_ogg.html":"",
+    "content/media/test/test_can_play_type_no_dash.html":"",
 
     "dom/imptests/editing/selecttest/test_addRange.html": "oom?, bug 775227",
     "dom/imptests/webapps/DOMCore/tests/approved/test_Range-insertNode.html":"oom?, bug 775227",
     "dom/imptests/webapps/DOMCore/tests/approved/test_Range-cloneContents.html":"",
     "dom/imptests/webapps/DOMCore/tests/approved/test_Range-compareBoundaryPoints.html":"times out, bug 862196",
     "dom/imptests/webapps/DOMCore/tests/approved/test_Range-deleteContents.html":"",
     "dom/imptests/webapps/DOMCore/tests/approved/test_Range-extractContents.html":"",
     "dom/imptests/webapps/DOMCore/tests/approved/test_Range-set.html":"",