Bug 932759 (part 2) - Have form sync work correctly if FormHistory is disabled. r=rnewman

This commit is contained in:
Mark Hammond 2014-02-26 17:12:16 +11:00
parent 99feb3d01a
commit 74f929ccaf
2 changed files with 22 additions and 0 deletions

View File

@ -53,6 +53,9 @@ let FormWrapper = {
},
_updateSpinningly: function(changes) {
if (!Svc.FormHistory.enabled) {
return; // update isn't going to do anything.
}
let cb = Async.makeSpinningCallback();
let callbacks = {
handleCompletion: function(reason) {

View File

@ -5,6 +5,7 @@ _("Make sure the form store follows the Store api and correctly accesses the bac
Cu.import("resource://services-sync/engines/forms.js");
Cu.import("resource://services-sync/service.js");
Cu.import("resource://services-sync/util.js");
Cu.import("resource://gre/modules/Services.jsm");
function run_test() {
let baseuri = "http://fake/uri/";
@ -129,4 +130,22 @@ function run_test() {
for (let id in store.getAllIDs()) {
do_throw("Shouldn't get any ids!");
}
_("Ensure we work if formfill is disabled.");
Services.prefs.setBoolPref("browser.formfill.enable", false);
try {
// a search
for (let id in store.getAllIDs()) {
do_throw("Shouldn't get any ids!");
}
// an update.
applyEnsureNoFailures([{
id: Utils.makeGUID(),
name: "some",
value: "entry"
}]);
} finally {
Services.prefs.clearUserPref("browser.formfill.enable");
store.wipe();
}
}