Backed out changeset 12c77a8f0e4a (bug 976940) cause consumers are not ready for it. r=post-facto

MozReview-Commit-ID: HGOeEgMFTLk
This commit is contained in:
Marco Bonardo 2016-02-25 17:15:01 +01:00
Родитель b84da33d51
Коммит f769db6251
2 изменённых файлов: 4 добавлений и 37 удалений

Просмотреть файл

@ -842,6 +842,10 @@ this.FormHistory = {
},
update : function formHistoryUpdate(aChanges, aCallbacks) {
if (!Prefs.enabled) {
return;
}
// Used to keep track of how many searches have been started. When that number
// are finished, updateFormHistoryWrite can be called.
let numSearches = 0;
@ -856,13 +860,6 @@ this.FormHistory = {
if (!("length" in aChanges))
aChanges = [aChanges];
let isRemoveOperation = aChanges.every(change => change && change.op && change.op == "remove");
if (!Prefs.enabled && !isRemoveOperation) {
throw Components.Exception(
"Form history is disabled, only remove operations are allowed",
Cr.NS_ERROR_ILLEGAL_VALUE);
}
for (let change of aChanges) {
switch (change.op) {
case "remove":

Просмотреть файл

@ -405,36 +405,6 @@ add_task(function* ()
yield promiseCountEntries(null, null, num => do_check_eq(num, 4));
// ===== 21 =====
// Check update throws if form history is disabled and the operation is not a
// pure removal.
testnum++;
Services.prefs.setBoolPref("browser.formfill.enable", false);
Assert.throws(() => promiseUpdate(
{ op : "bump", fieldname: "field5", value: "value5" }),
/NS_ERROR_ILLEGAL_VALUE/);
Assert.throws(() => promiseUpdate(
{ op : "add", fieldname: "field5", value: "value5" }),
/NS_ERROR_ILLEGAL_VALUE/);
Assert.throws(() => promiseUpdate([
{ op : "update", fieldname: "field5", value: "value5" },
{ op : "remove", fieldname: "field5", value: "value5" }
]),
/NS_ERROR_ILLEGAL_VALUE/);
Assert.throws(() => promiseUpdate([
null,
undefined,
"",
1,
{},
{ op : "remove", fieldname: "field5", value: "value5" }
]),
/NS_ERROR_ILLEGAL_VALUE/);
// Remove should work though.
yield promiseUpdate([{ op: "remove", fieldname: "field5", value: null },
{ op: "remove", fieldname: null, value: null }]);
Services.prefs.clearUserPref("browser.formfill.enable");
} catch (e) {
throw "FAILED in test #" + testnum + " -- " + e;
}