Bug 1747461 - Remove FileUtils.getFile from browser/components/enterprisepolicies r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D134894
This commit is contained in:
@@ -2400,7 +2400,10 @@ function clearRunOnceModification(actionName) {
|
||||
|
||||
function replacePathVariables(path) {
|
||||
if (path.includes("${home}")) {
|
||||
return path.replace("${home}", FileUtils.getFile("Home", []).path);
|
||||
return path.replace(
|
||||
"${home}",
|
||||
Services.dirsvc.get("Home", Ci.nsIFile).path
|
||||
);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
@@ -3,12 +3,6 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"FileUtils",
|
||||
"resource://gre/modules/FileUtils.jsm"
|
||||
);
|
||||
|
||||
add_task(async function test_defaultdownload() {
|
||||
await setupPolicyEngineWithJson({
|
||||
policies: {
|
||||
@@ -33,7 +27,7 @@ add_task(async function test_defaultdownload() {
|
||||
true,
|
||||
"saveTo should be disabled."
|
||||
);
|
||||
let home = FileUtils.getFile("Home", []).path;
|
||||
let home = Services.dirsvc.get("Home", Ci.nsIFile).path;
|
||||
is(
|
||||
Services.prefs.getStringPref("browser.download.dir"),
|
||||
home + "/Downloads",
|
||||
@@ -85,7 +79,7 @@ add_task(async function test_download() {
|
||||
true,
|
||||
"chooseFolder should be disabled."
|
||||
);
|
||||
let home = FileUtils.getFile("Home", []).path;
|
||||
let home = Services.dirsvc.get("Home", Ci.nsIFile).path;
|
||||
is(
|
||||
Services.prefs.getStringPref("browser.download.dir"),
|
||||
home + "/Documents",
|
||||
|
||||
Reference in New Issue
Block a user