diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-05-03 05:55:15 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-05-03 05:55:15 +0200 |
commit | 43f7a588f96aaf88e7b69441c3b50bc9c7b20df7 (patch) | |
tree | 07d9b26b2f357ee9de04fea0e5e4b8b9a1ff93a4 /security/sandbox/test/browser_content_sandbox_utils.js | |
parent | 4613b91ecac2745252c40be64e73de5ff920b02b (diff) | |
download | UXP-43f7a588f96aaf88e7b69441c3b50bc9c7b20df7.tar UXP-43f7a588f96aaf88e7b69441c3b50bc9c7b20df7.tar.gz UXP-43f7a588f96aaf88e7b69441c3b50bc9c7b20df7.tar.lz UXP-43f7a588f96aaf88e7b69441c3b50bc9c7b20df7.tar.xz UXP-43f7a588f96aaf88e7b69441c3b50bc9c7b20df7.zip |
Nuke the sandbox
Diffstat (limited to 'security/sandbox/test/browser_content_sandbox_utils.js')
-rw-r--r-- | security/sandbox/test/browser_content_sandbox_utils.js | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/security/sandbox/test/browser_content_sandbox_utils.js b/security/sandbox/test/browser_content_sandbox_utils.js deleted file mode 100644 index 0e9d01352..000000000 --- a/security/sandbox/test/browser_content_sandbox_utils.js +++ /dev/null @@ -1,57 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"] - .getService(Ci.nsIUUIDGenerator); - -/* - * Utility functions for the browser content sandbox tests. - */ - -function isMac() { return Services.appinfo.OS == "Darwin" } -function isWin() { return Services.appinfo.OS == "WINNT" } -function isLinux() { return Services.appinfo.OS == "Linux" } - -function isNightly() { - let version = SpecialPowers.Cc["@mozilla.org/xre/app-info;1"]. - getService(SpecialPowers.Ci.nsIXULAppInfo).version; - return (version.endsWith("a1")); -} - -function uuid() { - return uuidGenerator.generateUUID().toString(); -} - -// Returns a file object for a new file in the home dir ($HOME/<UUID>). -function fileInHomeDir() { - // get home directory, make sure it exists - let homeDir = Services.dirsvc.get("Home", Ci.nsILocalFile); - Assert.ok(homeDir.exists(), "Home dir exists"); - Assert.ok(homeDir.isDirectory(), "Home dir is a directory"); - - // build a file object for a new file named $HOME/<UUID> - let homeFile = homeDir.clone(); - homeFile.appendRelativePath(uuid()); - Assert.ok(!homeFile.exists(), homeFile.path + " does not exist"); - return (homeFile); -} - -// Returns a file object for a new file in the content temp dir (.../<UUID>). -function fileInTempDir() { - let contentTempKey = "ContentTmpD"; - if (Services.appinfo.OS == "Linux") { - // Linux builds don't use the content-specific temp key - contentTempKey = "TmpD"; - } - - // get the content temp dir, make sure it exists - let ctmp = Services.dirsvc.get(contentTempKey, Ci.nsILocalFile); - Assert.ok(ctmp.exists(), "Content temp dir exists"); - Assert.ok(ctmp.isDirectory(), "Content temp dir is a directory"); - - // build a file object for a new file in content temp - let tempFile = ctmp.clone(); - tempFile.appendRelativePath(uuid()); - Assert.ok(!tempFile.exists(), tempFile.path + " does not exist"); - return (tempFile); -} |