Bug 775588 - Test that temporary directory, profile directory are present. r=yoric
authorDavid Rajchenbach-Teller <dteller@mozilla.com>
Wed, 22 Aug 2012 16:58:09 -0400
changeset 105106 dba7f413d26b56cf6d0060f508c0a4556c10a24c
parent 105105 a9fefd087abca7b6685beb8796e13f1935708f07
child 105107 004b8c1500c2305f02277b991ddb21d08d444ec4
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersyoric
bugs775588
milestone17.0a1
Bug 775588 - Test that temporary directory, profile directory are present. r=yoric
toolkit/components/osfile/tests/mochi/test_osfile_front.xul
--- a/toolkit/components/osfile/tests/mochi/test_osfile_front.xul
+++ b/toolkit/components/osfile/tests/mochi/test_osfile_front.xul
@@ -10,19 +10,33 @@
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
   <script type="application/javascript">
   <![CDATA[
 
 let worker;
+let main = this;
 
 function test() {
   ok(true, "test_osfile_front.xul: Starting test");
+
+  // Test OS.Constants.Path
+
+  Components.classes["@mozilla.org/net/osfileconstantsservice;1"].
+    getService(Components.interfaces.nsIOSFileConstantsService).
+    init();
+  Components.utils.import("resource://gre/modules/Services.jsm");
+
+  is(OS.Constants.Path.tmpDir, Services.dirsvc.get("TmpD", Components.interfaces.nsIFile).path, "OS.Constants.Path.tmpDir is correct");
+  is(OS.Constants.Path.profileDir, Services.dirsvc.get("ProfD", Components.interfaces.nsIFile).path, "OS.Constants.Path.profileDir is correct");
+
+  // Test the OS.File worker
+
   worker = new ChromeWorker("worker_test_osfile_front.js");
   SimpleTest.waitForExplicitFinish();
   ok(true, "test_osfile_front.xul: Chrome worker created");
   dump("MAIN: go\n");
   worker.onerror = function(error) {
     error.preventDefault();
     ok(false, "error "+error);
   }