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

Unified 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: Nits Created July 23, 2018, 9:01 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/content/elemHideEmulation.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/browser/elemHideEmulation.js
===================================================================
--- a/test/browser/elemHideEmulation.js
+++ b/test/browser/elemHideEmulation.js
@@ -236,16 +236,42 @@
).then(() =>
{
expectVisible(test, parent);
expectVisible(test, middle);
expectHidden(test, toHide);
}).catch(unexpectedError.bind(test)).then(() => test.done());
};
+// Add the style. Then add the element for that style.
+// This should retrigger the filtering and hide it.
+exports.testPropertyPseudoSelectorAddStyleAndElement = function(test)
+{
+ let styleElement;
+ let toHide;
+ applyElemHideEmulation(
+ [":-abp-properties(background-color: rgb(0, 0, 0))"]
+ ).then(() =>
+ {
+ styleElement = testDocument.createElement("style");
+ testDocument.head.appendChild(styleElement);
+ styleElement.sheet.insertRule("#toHide {background-color: #000}");
+ return timeout(REFRESH_INTERVAL);
+ }).then(() =>
+ {
+ toHide = createElement();
+ toHide.id = "toHide";
+ expectVisible(test, toHide);
+ return timeout(REFRESH_INTERVAL);
+ }).then(() =>
+ {
+ expectHidden(test, toHide);
+ }).catch(unexpectedError.bind(test)).then(() => test.done());
+};
+
exports.testPropertySelectorWithWildcard = function(test)
{
let toHide = createElementWithStyle("{background-color: #000}");
applyElemHideEmulation(
[":-abp-properties(*color: rgb(0, 0, 0))"]
).then(() =>
{
expectHidden(test, toHide);
« 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