зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset edcb067bb8ea (bug 1582740
) for failures on browser_defaultbrowser_alwayscheck.js. CLOSED TREE
This commit is contained in:
Родитель
601789bfbc
Коммит
3944bd0e48
|
@ -40,7 +40,6 @@
|
||||||
#ifdef HAVE_SHELL_SERVICE
|
#ifdef HAVE_SHELL_SERVICE
|
||||||
<vbox id="defaultBrowserBox">
|
<vbox id="defaultBrowserBox">
|
||||||
<checkbox id="alwaysCheckDefault" preference="browser.shell.checkDefaultBrowser"
|
<checkbox id="alwaysCheckDefault" preference="browser.shell.checkDefaultBrowser"
|
||||||
disabled="true"
|
|
||||||
data-l10n-id="always-check-default"/>
|
data-l10n-id="always-check-default"/>
|
||||||
<deck id="setDefaultPane">
|
<deck id="setDefaultPane">
|
||||||
<hbox align="center" class="indent">
|
<hbox align="center" class="indent">
|
||||||
|
|
|
@ -1268,10 +1268,8 @@ var gMainPane = {
|
||||||
let isDefault = shellSvc.isDefaultBrowser(false, true);
|
let isDefault = shellSvc.isDefaultBrowser(false, true);
|
||||||
setDefaultPane.selectedIndex = isDefault ? 1 : 0;
|
setDefaultPane.selectedIndex = isDefault ? 1 : 0;
|
||||||
let alwaysCheck = document.getElementById("alwaysCheckDefault");
|
let alwaysCheck = document.getElementById("alwaysCheckDefault");
|
||||||
let alwaysCheckPref = Preferences.get(
|
alwaysCheck.disabled =
|
||||||
"browser.shell.checkDefaultBrowser"
|
alwaysCheck.disabled || (isDefault && alwaysCheck.checked);
|
||||||
);
|
|
||||||
alwaysCheck.disabled = alwaysCheckPref.locked || isDefault;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -106,38 +106,6 @@ add_task(async function clicking_make_default_checks_alwaysCheck_checkbox() {
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function make_default_disabled_until_prefs_are_loaded() {
|
|
||||||
// Testcase with Firefox not set as the default browser
|
|
||||||
await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:preferences");
|
|
||||||
await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
|
|
||||||
let alwaysCheck = content.document.getElementById("alwaysCheckDefault");
|
|
||||||
Assert.ok(alwaysCheck.disabled, "'Always Check' is disabled on page load");
|
|
||||||
});
|
|
||||||
await test_with_mock_shellservice({ isDefault: false }, async function() {
|
|
||||||
let alwaysCheck = content.document.getElementById("alwaysCheckDefault");
|
|
||||||
Assert.ok(
|
|
||||||
!alwaysCheck.disabled,
|
|
||||||
"'Always Check' is enabled after default browser updated"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
gBrowser.removeCurrentTab();
|
|
||||||
|
|
||||||
// Testcase with Firefox set as the default browser
|
|
||||||
await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:preferences");
|
|
||||||
await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
|
|
||||||
let alwaysCheck = content.document.getElementById("alwaysCheckDefault");
|
|
||||||
Assert.ok(alwaysCheck.disabled, "'Always Check' is disabled on page load");
|
|
||||||
});
|
|
||||||
await test_with_mock_shellservice({ isDefault: true }, async function() {
|
|
||||||
let alwaysCheck = content.document.getElementById("alwaysCheckDefault");
|
|
||||||
Assert.ok(
|
|
||||||
alwaysCheck.disabled,
|
|
||||||
"'Always Check' is still disabled after default browser updated"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
gBrowser.removeCurrentTab();
|
|
||||||
});
|
|
||||||
|
|
||||||
registerCleanupFunction(function() {
|
registerCleanupFunction(function() {
|
||||||
Services.prefs.unlockPref("browser.shell.checkDefaultBrowser");
|
Services.prefs.unlockPref("browser.shell.checkDefaultBrowser");
|
||||||
Services.prefs.setBoolPref(
|
Services.prefs.setBoolPref(
|
||||||
|
|
Загрузка…
Ссылка в новой задаче