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