зеркало из https://github.com/mozilla/gecko-dev.git
Bug 826146 - Add a pref-controlled install confirmation override for automation. r=sicking
This commit is contained in:
Родитель
ecb358d581
Коммит
83c1284aff
|
@ -1382,9 +1382,17 @@ this.DOMApplicationRegistry = {
|
|||
sendError("INVALID_SECURITY_LEVEL");
|
||||
} else {
|
||||
app.etag = xhr.getResponseHeader("Etag");
|
||||
// We allow bypassing the install confirmation process to facilitate
|
||||
// automation.
|
||||
let prefName = "dom.mozApps.auto_confirm_install";
|
||||
if (Services.prefs.prefHasUserValue(prefName) &&
|
||||
Services.prefs.getBoolPref(prefName)) {
|
||||
this.confirmInstall(aData);
|
||||
} else {
|
||||
Services.obs.notifyObservers(aMm, "webapps-ask-install",
|
||||
JSON.stringify(aData));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sendError("MANIFEST_URL_ERROR");
|
||||
}
|
||||
|
|
|
@ -713,6 +713,14 @@ SpecialPowersAPI.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
// Disables the app install prompt for the duration of this test. There is
|
||||
// no need to re-enable the prompt at the end of the test.
|
||||
//
|
||||
// The provided callback is invoked once the prompt is disabled.
|
||||
autoConfirmAppInstall: function(cb) {
|
||||
this.pushPrefEnv({set: [['dom.mozApps.auto_confirm_install', true]]}, cb);
|
||||
},
|
||||
|
||||
addObserver: function(obs, notification, weak) {
|
||||
var obsvc = Cc['@mozilla.org/observer-service;1']
|
||||
.getService(Ci.nsIObserverService);
|
||||
|
|
Загрузка…
Ссылка в новой задаче