xpcom/tests/unit/test_bug478086.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* Any copyright is dedicated to the Public Domain.
     2  * http://creativecommons.org/licenses/publicdomain/  */
     4 function run_test() {
     5   var nsILocalFile = Components.interfaces.nsILocalFile;
     6   var root = Components.classes["@mozilla.org/file/local;1"].
     7               createInstance(nsILocalFile);
     9   // copied from http://mxr.mozilla.org/mozilla-central/source/image/test/unit/test_imgtools.js#135
    10   // nsIXULRuntime.OS doesn't seem to be available in xpcshell, so we'll use
    11   // this as a kludgy way to figure out if we're running on Windows.
    12   var isWindows = ("@mozilla.org/windows-registry-key;1" in Components.classes);
    13   if (isWindows) {
    14     root.initWithPath("\\\\.");
    15   } else {
    16     return; // XXX disabled, since this causes intermittent failures on Mac (bug 481369).
    17     root.initWithPath("/");
    18   }
    19   var drives = root.directoryEntries;
    20   do_check_true(drives.hasMoreElements());
    21   while (drives.hasMoreElements()) {
    22     var newPath = drives.getNext().QueryInterface(nsILocalFile).path;
    23     do_check_eq(newPath.indexOf("\0"), -1);
    24   }
    25 }

mercurial