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 Dec. 3, 2015, 12: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.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);
Wladimir Palant 2015/12/04 13:09:48 This is an unnecessary roundtrip - result.cssrule.
Thomas Greiner 2015/12/07 17:29:26 Done.
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
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 })();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld