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

Side by Side Diff: test/browser/elemHideEmulation.js

Issue 29836555: Issue 6680 - PropsSelector also depend on DOM modifications (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created July 23, 2018, 1:01 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/content/elemHideEmulation.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 applyElemHideEmulation( 234 applyElemHideEmulation(
235 ["div > :-abp-properties(background-color: rgb(0, 0, 0)) > div"] 235 ["div > :-abp-properties(background-color: rgb(0, 0, 0)) > div"]
236 ).then(() => 236 ).then(() =>
237 { 237 {
238 expectVisible(test, parent); 238 expectVisible(test, parent);
239 expectVisible(test, middle); 239 expectVisible(test, middle);
240 expectHidden(test, toHide); 240 expectHidden(test, toHide);
241 }).catch(unexpectedError.bind(test)).then(() => test.done()); 241 }).catch(unexpectedError.bind(test)).then(() => test.done());
242 }; 242 };
243 243
244 //
Manish Jethani 2018/07/23 20:44:01 Nit: We don't need these extra blank lines in the
hub 2018/07/23 21:01:57 Done.
245 // Add the style. Then added the element for that style.
Manish Jethani 2018/07/23 20:44:01 s/added/add/
hub 2018/07/23 21:01:57 Done.
246 // This should retrigger the filter and hide it.
Manish Jethani 2018/07/23 20:44:01 s/filter/filtering/
hub 2018/07/23 21:01:58 Done.
247 //
248 exports.testPropertyPseudoSelectorAddedStyleAndElement = function(test)
Manish Jethani 2018/07/23 20:44:01 s/Added/Add/
hub 2018/07/23 21:01:58 Done.
249 {
250 let styleElement;
251 let toHide;
252 applyElemHideEmulation(
253 [":-abp-properties(background-color: rgb(0, 0, 0))"]
254 ).then(() =>
255 {
256 styleElement = testDocument.createElement("style");
257 testDocument.head.appendChild(styleElement);
258 styleElement.sheet.insertRule("#toHide {background-color: #000}");
259 return timeout(REFRESH_INTERVAL);
260 }).then(() =>
261 {
262 toHide = createElement();
263 toHide.id = "toHide";
264 expectVisible(test, toHide);
265 return timeout(REFRESH_INTERVAL);
266 }).then(() =>
267 {
268 expectHidden(test, toHide);
269 }).catch(unexpectedError.bind(test)).then(() => test.done());
270 };
271
244 exports.testPropertySelectorWithWildcard = function(test) 272 exports.testPropertySelectorWithWildcard = function(test)
245 { 273 {
246 let toHide = createElementWithStyle("{background-color: #000}"); 274 let toHide = createElementWithStyle("{background-color: #000}");
247 applyElemHideEmulation( 275 applyElemHideEmulation(
248 [":-abp-properties(*color: rgb(0, 0, 0))"] 276 [":-abp-properties(*color: rgb(0, 0, 0))"]
249 ).then(() => 277 ).then(() =>
250 { 278 {
251 expectHidden(test, toHide); 279 expectHidden(test, toHide);
252 }).catch(unexpectedError.bind(test)).then(() => test.done()); 280 }).catch(unexpectedError.bind(test)).then(() => test.done());
253 }; 281 };
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 for (let element of [...testDocument.getElementsByTagName("div"), 1043 for (let element of [...testDocument.getElementsByTagName("div"),
1016 ...testDocument.getElementsByTagName("p")]) 1044 ...testDocument.getElementsByTagName("p")])
1017 { 1045 {
1018 if (element.id == "n2" || element.id == "n2_3") 1046 if (element.id == "n2" || element.id == "n2_3")
1019 expectProcessed(test, element, element.id); 1047 expectProcessed(test, element, element.id);
1020 else 1048 else
1021 expectNotProcessed(test, element, element.id); 1049 expectNotProcessed(test, element, element.id);
1022 } 1050 }
1023 }).catch(unexpectedError.bind(test)).then(() => test.done()); 1051 }).catch(unexpectedError.bind(test)).then(() => test.done());
1024 }; 1052 };
OLDNEW
« no previous file with comments | « lib/content/elemHideEmulation.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld