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 224803 e50f912fdcd2da0d7fc92556a500c2e922947359
parent 224802 6703d9aa4a0ac899c4702c3323c805a83a0b0759
child 224804 33771884957afc3911fc0baf64c26a20e337b86c
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstest-only
bugs1008481
milestone34.0a2
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();
         }
       });