Bug 759221 - 2/6 - don't use file URIs in Android mochitests - r=jmaher
authorBenoit Jacob <bjacob@mozilla.com>
Fri, 08 Jun 2012 13:41:38 -0400
changeset 100994 92d9e76d7ed3625a8fa97da610e63fad55d4c33e
parent 100993 b4aae26ccbfb32fadf7311b79040afc4c5f8505f
child 100995 e158c9ebe4a2a78996049eee46e3a644b62f23ec
push id1316
push userakeybl@mozilla.com
push dateMon, 27 Aug 2012 22:37:00 +0000
treeherdermozilla-beta@db4b09302ee2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs759221
milestone16.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 759221 - 2/6 - don't use file URIs in Android mochitests - r=jmaher
content/media/test/manifest.js
--- a/content/media/test/manifest.js
+++ b/content/media/test/manifest.js
@@ -150,16 +150,20 @@ var gPlayTests = [
   // Invalid file
   { name:"bogus.duh", type:"bogus/duh", duration:Number.NaN }
 ];
 
 // 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)
+    return path;
+
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   const Ci = Components.interfaces;
   const Cc = Components.classes;
   const Cr = Components.results;
   var dirSvc = Cc["@mozilla.org/file/directory_service;1"].
                getService(Ci.nsIProperties);
   var f = dirSvc.get("CurWorkD", Ci.nsILocalFile);
   var split = path.split("/");