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

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

Issue 29356283: Issue 4500 - Fix element hiding integration tests (Closed) Base URL: https://hg.adblockplus.org/adblockplustests
Left Patch Set: Addressed nit Created Oct. 7, 2016, 10:15 a.m.
Right Patch Set: Addressed one more nit Created Oct. 7, 2016, 10:40 a.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 | « no previous file | 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 let server = null; 3 let server = null;
4 let frame = null; 4 let frame = null;
5 5
6 module("Element hiding", { 6 module("Element hiding", {
7 setup: function() 7 setup: function()
8 { 8 {
9 prepareFilterComponents.call(this); 9 prepareFilterComponents.call(this);
10 preparePrefs.call(this); 10 preparePrefs.call(this);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 [["##div#test1", "@@localhost$generichide"], ["visible", "visible"]], 111 [["##div#test1", "@@localhost$generichide"], ["visible", "visible"]],
112 [["##div#test1", "@@localhost$genericblock"], ["hidden", "visible"]], 112 [["##div#test1", "@@localhost$genericblock"], ["hidden", "visible"]],
113 [["localhost##div#test1", "@@localhost$generichide"], ["hidden", "visible"]] , 113 [["localhost##div#test1", "@@localhost$generichide"], ["hidden", "visible"]] ,
114 [["~example.com##div#test1", "@@localhost$generichide"], ["visible", "visibl e"]], 114 [["~example.com##div#test1", "@@localhost$generichide"], ["visible", "visibl e"]],
115 [["~example.com##div#test1", "@@localhost$genericblock"], ["hidden", "visibl e"]], 115 [["~example.com##div#test1", "@@localhost$genericblock"], ["hidden", "visibl e"]],
116 [["~example.com,localhost##div#test1", "@@localhost$generichide"], ["hidden" , "visible"]], 116 [["~example.com,localhost##div#test1", "@@localhost$generichide"], ["hidden" , "visible"]],
117 ]; 117 ];
118 118
119 function runTest([filters, expected], stage) 119 function runTest([filters, expected], stage)
120 { 120 {
121 for (let filter_text of filters) 121 for (let filterText of filters)
122 FilterStorage.addFilter(Filter.fromText(filter_text)); 122 FilterStorage.addFilter(Filter.fromText(filterText));
123 123
124 if (stage == 2) 124 if (stage == 2)
125 FilterStorage.addFilter(Filter.fromText("@@||localhost^$document")); 125 FilterStorage.addFilter(Filter.fromText("@@||localhost^$document"));
126 else if (stage == 3) 126 else if (stage == 3)
127 FilterStorage.addFilter(Filter.fromText("@@||localhost^$~document")); 127 FilterStorage.addFilter(Filter.fromText("@@||localhost^$~document"));
128 else if (stage == 4) 128 else if (stage == 4)
129 FilterStorage.addFilter(Filter.fromText("@@||localhost^$elemhide")); 129 FilterStorage.addFilter(Filter.fromText("@@||localhost^$elemhide"));
130 130
131 // Second and forth runs are whitelisted, nothing should be hidden 131 // Second and forth runs are whitelisted, nothing should be hidden
132 if (stage == 2 || stage == 4) 132 if (stage == 2 || stage == 4)
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 4: "running with element hiding exception", 170 4: "running with element hiding exception",
171 }; 171 };
172 172
173 for (let test = 0; test < tests.length; test++) 173 for (let test = 0; test < tests.length; test++)
174 { 174 {
175 let [filters, expected] = tests[test]; 175 let [filters, expected] = tests[test];
176 for (let stage = 1; stage in stageDescriptions; stage++) 176 for (let stage = 1; stage in stageDescriptions; stage++)
177 asyncTest(filters.join(", ") + " (" + stageDescriptions[stage] + ")", runT est.bind(null, tests[test], stage)); 177 asyncTest(filters.join(", ") + " (" + stageDescriptions[stage] + ")", runT est.bind(null, tests[test], stage));
178 } 178 }
179 })(); 179 })();
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld