Commit 39f1cea2 authored by Michael Kaply's avatar Michael Kaply
Browse files

Bug 15470202 - Locking useDownloadDir shouldn't lock file chooser. r=jaws

Differential Revision: https://phabricator.services.mozilla.com/D28874

--HG--
extra : moz-landing-system : lando
parent 9b1a629d
......@@ -2203,9 +2203,11 @@ var gMainPane = {
readUseDownloadDir() {
var downloadFolder = document.getElementById("downloadFolder");
var chooseFolder = document.getElementById("chooseFolder");
var preference = Preferences.get("browser.download.useDownloadDir");
downloadFolder.disabled = !preference.value || preference.locked;
chooseFolder.disabled = !preference.value || preference.locked;
var useDownloadDirPreference = Preferences.get("browser.download.useDownloadDir");
var dirPreference = Preferences.get("browser.download.dir");
downloadFolder.disabled = !useDownloadDirPreference.value || dirPreference.locked;
chooseFolder.disabled = !useDownloadDirPreference.value || dirPreference.locked;
this.readCloudStorage().catch(Cu.reportError);
// don't override the preference's value in UI
......
......@@ -35,6 +35,7 @@ skip-if = (os == 'win' && (processor == "x86_64" || processor == "aarch64")) # B
[browser_bug1184989_prevent_scrolling_when_preferences_flipped.js]
support-files =
browser_bug1184989_prevent_scrolling_when_preferences_flipped.xul
[browser_bug1547020_lockedDownloadDir.js]
[browser_cookie_exceptions_addRemove.js]
[browser_cert_export.js]
[browser_engines.js]
......
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
add_task(async function() {
Services.prefs.lockPref("browser.download.useDownloadDir");
await openPreferencesViaOpenPreferencesAPI("general", { leaveOpen: true });
let doc = gBrowser.selectedBrowser.contentDocument;
var downloadFolder = doc.getElementById("downloadFolder");
var chooseFolder = doc.getElementById("chooseFolder");
is(downloadFolder.disabled, false, "Download folder field should not be disabled.");
is(chooseFolder.disabled, false, "Choose folder should not be disabled.");
gBrowser.removeCurrentTab();
Services.prefs.unlockPref("browser.download.useDownloadDir");
});
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment