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

Unified Diff: test/browser/elemHideEmulation.js

Issue 30035555: Issue 7428, 7400 - Add test case for nested :-abp-properties() (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Rebase Created April 3, 2019, 6: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 | « no previous file | 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
@@ -524,16 +524,56 @@
sibling: true,
sibling2: true,
toHide: true
};
runTestPseudoClassHasSelectorWithHasAndWithSuffixSibling(
test, "div:-abp-has(> span:-abp-contains(Advertisment))", expectations);
};
+// See issue https://issues.adblockplus.org/ticket/7359
+// and issue https://issues.adblockplus.org/ticket/7428
+async function runTestQualifier(test, selector)
+{
+ testDocument.body.innerHTML = `
+ <style>
+ span::before {
+ content: "any";
+ }
+ </style>
+ <div id="toHide">
+ <a>
+ <p>
+ <span></span>
+ </p>
+ </a>
+ </div>`;
+
+ if (await applyElemHideEmulation(test, [selector]))
+ expectHidden(test, testDocument.getElementById("toHide"));
+
+ test.done();
+}
+
+exports.testPropertySelectorCombinatorQualifier = function(test)
+{
+ runTestQualifier(
+ test,
+ "div:-abp-has(> a p > :-abp-properties(content: \"any\"))"
+ );
+};
+
+exports.testPropertySelectorCombinatorQualifierNested = function(test)
+{
+ runTestQualifier(
+ test,
+ "div:-abp-has(> a p:-abp-has(> span:-abp-properties(content: \"any\")))"
Manish Jethani 2019/04/03 18:37:40 Thanks for rebasing, it is looking good now, but s
hub 2019/04/03 18:53:20 Done.
+ );
+};
+
async function runTestPseudoClassContains(test, selector, expectations)
{
testDocument.body.innerHTML = `<div id="parent">
<div id="middle">
<div id="middle1"><div id="inside" class="inside"></div></div>
</div>
<div id="sibling">
<div id="tohide">to hide \ud83d\ude42!</div>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld