mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 13:25:37 +00:00
Bug 579779: Installing a new theme should mark it to be enabled. r=robstrong
This commit is contained in:
parent
d1e7808a06
commit
77af6a588c
@ -750,7 +750,7 @@ const gXPInstallObserver = {
|
||||
PopupNotifications.remove(notification);
|
||||
|
||||
var needsRestart = installInfo.installs.some(function(i) {
|
||||
return (i.addon.pendingOperations & AddonManager.PENDING_INSTALL) != 0;
|
||||
return i.addon.pendingOperations != AddonManager.PENDING_NONE;
|
||||
});
|
||||
|
||||
if (needsRestart) {
|
||||
|
@ -406,6 +406,36 @@ function test_reload() {
|
||||
gBrowser.loadURI(TESTROOT2 + "enabled.html");
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
function test_theme() {
|
||||
var pm = Services.perms;
|
||||
pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
|
||||
|
||||
var triggers = encodeURIComponent(JSON.stringify({
|
||||
"Theme XPI": "theme.xpi"
|
||||
}));
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
|
||||
|
||||
// Wait for the install confirmation dialog
|
||||
wait_for_install_dialog(function(aWindow) {
|
||||
aWindow.document.documentElement.acceptDialog();
|
||||
|
||||
// Wait for the complete notification
|
||||
wait_for_notification(function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
is(notification.id, "addon-install-complete", "Should have seen the install complete");
|
||||
is(notification.button.label, "Restart Now", "Should have seen the right button");
|
||||
is(notification.getAttribute("label"),
|
||||
"Theme Test will be installed after you restart " + gApp + ".",
|
||||
"Should have seen the right message");
|
||||
|
||||
gBrowser.removeTab(gBrowser.selectedTab);
|
||||
Services.perms.remove("example.com", "install");
|
||||
runNextTest();
|
||||
});
|
||||
});
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -253,6 +253,14 @@ Installer.prototype = {
|
||||
onInstallEnded: function(aInstall) {
|
||||
aInstall.removeListener(this);
|
||||
this.installed.push(aInstall);
|
||||
|
||||
// If installing a theme that is disabled and can be enabled then enable it
|
||||
if (aInstall.addon.type == "theme" &&
|
||||
aInstall.addon.userDisabled == true &&
|
||||
aInstall.addon.appDisabled == false) {
|
||||
aInstall.addon.userDisabled = false;
|
||||
}
|
||||
|
||||
this.checkAllInstalled();
|
||||
}
|
||||
};
|
||||
|
@ -91,6 +91,7 @@ _BROWSER_FILES = head.js \
|
||||
signed-no-cn.xpi \
|
||||
signed-untrusted.xpi \
|
||||
signed-tampered.xpi \
|
||||
theme.xpi \
|
||||
restartless.xpi \
|
||||
incompatible.xpi \
|
||||
empty.xpi \
|
||||
|
BIN
toolkit/mozapps/extensions/test/xpinstall/theme.xpi
Normal file
BIN
toolkit/mozapps/extensions/test/xpinstall/theme.xpi
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user