Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: chrome/content/tests/filterListener.js

Issue 29324604: Issue 2394 - Added unit tests for CSS property filters (Closed)
Left Patch Set: Created Aug. 25, 2015, 3:51 p.m.
Right Patch Set: Created Dec. 7, 2015, 5:21 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « chrome/content/tests/filterClasses.js ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
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
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 })();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld