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.filters) | 59 for (let filterText in CSSRulesGlobal.filters) |
60 { | 60 result.cssrule.push(filterText); |
61 let filter = Filter.fromText(key); | |
62 result.cssrule.push(filter.text); | |
63 } | |
64 | 61 |
65 let types = ["blacklist", "whitelist", "elemhide", "elemhideexception", | 62 let types = ["blacklist", "whitelist", "elemhide", "elemhideexception", |
66 "cssrule"]; | 63 "cssrule"]; |
67 for (let type of types) | 64 for (let type of types) |
68 if (!(type in expected)) | 65 if (!(type in expected)) |
69 expected[type] = []; | 66 expected[type] = []; |
70 | 67 |
71 deepEqual(result, expected, text); | 68 deepEqual(result, expected, text); |
72 } | 69 } |
73 | 70 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 subscription3.disabled = true; | 271 subscription3.disabled = true; |
275 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]}); |
276 | 273 |
277 FilterStorage.removeSubscription(subscription4); | 274 FilterStorage.removeSubscription(subscription4); |
278 checkKnownFilters("remove subscription from the list", {blacklist: [filter1.
text]}); | 275 checkKnownFilters("remove subscription from the list", {blacklist: [filter1.
text]}); |
279 | 276 |
280 subscription3.disabled = false; | 277 subscription3.disabled = false; |
281 checkKnownFilters("enable exception rules", {blacklist: [filter1.text], whit
elist: [filter2.text]}); | 278 checkKnownFilters("enable exception rules", {blacklist: [filter1.text], whit
elist: [filter2.text]}); |
282 }); | 279 }); |
283 })(); | 280 })(); |
LEFT | RIGHT |