LEFT | RIGHT |
1 (function() | 1 (function() |
2 { | 2 { |
3 module("Filter listener", { | 3 module("Filter listener", { |
4 setup: function() | 4 setup: function() |
5 { | 5 { |
6 prepareFilterComponents.call(this, true); | 6 prepareFilterComponents.call(this, true); |
7 preparePrefs.call(this); | 7 preparePrefs.call(this); |
8 | 8 |
9 FilterStorage.addSubscription(Subscription.fromURL("~fl~")); | 9 FilterStorage.addSubscription(Subscription.fromURL("~fl~")); |
10 FilterStorage.addSubscription(Subscription.fromURL("~wl~")); | 10 FilterStorage.addSubscription(Subscription.fromURL("~wl~")); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 result.elemhideexception = []; | 49 result.elemhideexception = []; |
50 for (let selector in ElemHideGlobal.exceptions) | 50 for (let selector in ElemHideGlobal.exceptions) |
51 { | 51 { |
52 let list = ElemHideGlobal.exceptions[selector]; | 52 let list = ElemHideGlobal.exceptions[selector]; |
53 for (let exception of list) | 53 for (let exception of list) |
54 result.elemhideexception.push(exception.text); | 54 result.elemhideexception.push(exception.text); |
55 } | 55 } |
56 | 56 |
57 let CSSRulesGlobal = getModuleGlobal("cssRules"); | 57 let CSSRulesGlobal = getModuleGlobal("cssRules"); |
58 result.cssrule = []; | 58 result.cssrule = []; |
59 for (let key in CSSRulesGlobal.filterByKey) | 59 for (let filterText in CSSRulesGlobal.filters) |
60 result.cssrule.push(CSSRulesGlobal.filterByKey[key].text); | 60 result.cssrule.push(filterText); |
61 | 61 |
62 let types = ["blacklist", "whitelist", "elemhide", "elemhideexception", | 62 let types = ["blacklist", "whitelist", "elemhide", "elemhideexception", |
63 "cssrule"]; | 63 "cssrule"]; |
64 for (let type of types) | 64 for (let type of types) |
65 if (!(type in expected)) | 65 if (!(type in expected)) |
66 expected[type] = []; | 66 expected[type] = []; |
67 | 67 |
68 deepEqual(result, expected, text); | 68 deepEqual(result, expected, text); |
69 } | 69 } |
70 | 70 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 subscription3.disabled = true; | 271 subscription3.disabled = true; |
272 checkKnownFilters("disable exception rules", {blacklist: [filter1.text, filt
er3.text], whitelist: [filter2.text]}); | 272 checkKnownFilters("disable exception rules", {blacklist: [filter1.text, filt
er3.text], whitelist: [filter2.text]}); |
273 | 273 |
274 FilterStorage.removeSubscription(subscription4); | 274 FilterStorage.removeSubscription(subscription4); |
275 checkKnownFilters("remove subscription from the list", {blacklist: [filter1.
text]}); | 275 checkKnownFilters("remove subscription from the list", {blacklist: [filter1.
text]}); |
276 | 276 |
277 subscription3.disabled = false; | 277 subscription3.disabled = false; |
278 checkKnownFilters("enable exception rules", {blacklist: [filter1.text], whit
elist: [filter2.text]}); | 278 checkKnownFilters("enable exception rules", {blacklist: [filter1.text], whit
elist: [filter2.text]}); |
279 }); | 279 }); |
280 })(); | 280 })(); |
LEFT | RIGHT |