Bug 1008481 - Switch to the root dir instead of the profile dir. a=test-only
authorBobby Holley <bobbyholley@gmail.com>
Tue, 09 Sep 2014 21:52:31 -0700
changeset 216736 f58da8f6f47e
parent 216735 a91c79c7e64e
child 216737 1c636d0e8ec1
push id3893
push userryanvm@gmail.com
push date2014-09-15 15:46 +0000
treeherdermozilla-beta@1c636d0e8ec1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstest-only
bugs1008481
milestone33.0
Bug 1008481 - Switch to the root dir instead of the profile dir. a=test-only
caps/tests/mochitest/test_bug995943.xul
--- a/caps/tests/mochitest/test_bug995943.xul
+++ b/caps/tests/mochitest/test_bug995943.xul
@@ -20,36 +20,37 @@ https://bugzilla.mozilla.org/show_bug.cg
   const Cu = Components.utils;
   const Cc = Components.classes;
   const Ci = Components.interfaces;
   Cu.import("resource://gre/modules/Services.jsm");
   function debug(msg) { info(msg); }
 
   /** Test for CAPS file:// URI prefs. **/
   SimpleTest.waitForExplicitFinish();
+  SimpleTest.requestCompleteLog();
+  if (Services.appinfo.OS == "Darwin") // See bug 1067022
+    SimpleTest.expectAssertions(0, 1);
 
-  var profileDir = "file://" + Cc["@mozilla.org/file/directory_service;1"]
-                               .getService(Ci.nsIProperties)
-                               .get("ProfD", Ci.nsILocalFile).path;
+  var rootdir = Services.appinfo.OS == "WINNT" ? "file:///C:" : "file:///";
 
   function checkLoadFileURI(domain, shouldLoad) {
     debug("Invoking checkLoadFileURI with domain: " + domain + ", shouldLoad: " + shouldLoad);
     return new Promise(function(resolve, reject) {
       $('ifr').addEventListener('load', function l1() {
         debug("Invoked l1 for " + domain);
         $('ifr').removeEventListener('load', l1);
         function l2() {
           debug("Invoked l2 for " + domain);
           $('ifr').removeEventListener('load', l2);
           ok(shouldLoad, "Successfully loaded file:// URI for domain: " + domain);
           resolve();
         }
         $('ifr').addEventListener('load', l2);
         try {
-          window[0].wrappedJSObject.location = profileDir;
+          window[0].wrappedJSObject.location = rootdir;
           debug("Successfully navigated for " + domain);
         } catch (e) {
           ok(!shouldLoad && /denied|insecure/.test(e),
              "Prevented loading of file:// URI for domain: " + domain + " - " + e);
           $('ifr').removeEventListener('load', l2);
           resolve();
         }
       });