Bug 1297238 - Make sync forms tracker respect ignoreAll property r=markh

MozReview-Commit-ID: AuIWNcRux3b

--HG--
extra : rebase_source : e940a484b58fdcd1b6fbf2cdad833599d22d5afe
This commit is contained in:
Thom Chiovoloni 2016-09-23 13:58:19 -04:00
Родитель ae63800553
Коммит 1a6d2a1483
2 изменённых файлов: 17 добавлений и 1 удалений

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

@ -233,7 +233,9 @@ FormTracker.prototype = {
observe: function (subject, topic, data) {
Tracker.prototype.observe.call(this, subject, topic, data);
if (this.ignoreAll) {
return;
}
switch (topic) {
case "satchel-storage-changed":
if (data == "formhistory-add" || data == "formhistory-remove") {

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

@ -40,6 +40,18 @@ function run_test() {
addEntry("address", "Memory Lane");
do_check_attribute_count(tracker.changedIDs, 3);
_("Check that ignoreAll is respected");
tracker.clearChangedIDs();
tracker.score = 0;
tracker.ignoreAll = true;
addEntry("username", "johndoe123");
addEntry("favoritecolor", "green");
removeEntry("name", "John Doe");
tracker.ignoreAll = false;
do_check_empty(tracker.changedIDs);
equal(tracker.score, 0);
_("Let's stop tracking again.");
tracker.clearChangedIDs();
Svc.Obs.notify("weave:engine:stop-tracking");
@ -51,6 +63,8 @@ function run_test() {
removeEntry("email", "john@doe.com");
do_check_empty(tracker.changedIDs);
} finally {
_("Clean up.");
engine._store.wipe();