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

Unified Diff: test/browser/elemHideEmulation.js

Issue 29770601: Issue 6649 - Allow u flag in :-abp-contains() (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Add tests Created May 5, 2018, 2 a.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
@@ -489,17 +489,17 @@
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</div>
+ <div id="tohide">to hide \ud83d\ude42!</div>
</div>
<div id="sibling2">
<div id="sibling21"><div id="sibling211" class="inside">Ad*</div></div>
</div>
</div>`;
let elems = {
parent: testDocument.getElementById("parent"),
middle: testDocument.getElementById("middle"),
@@ -553,16 +553,30 @@
sibling: false,
sibling2: true,
toHide: true
};
runTestPseudoClassContains(
test, "#parent div:-abp-contains(/to\\sHide/i)", expectations);
};
+exports.testPseudoClassContainsRegexpUFlag = function(test)
+{
+ let expectations = {
+ parent: true,
+ middle: true,
+ inside: true,
+ sibling: false,
+ sibling2: true,
+ toHide: true
+ };
+ runTestPseudoClassContains(
+ test, "#parent div:-abp-contains(/to\\shide\\s.!/u)", expectations);
Manish Jethani 2018/05/05 02:01:49 With the u flag the dot will match the entire Unic
+};
+
exports.testPseudoClassContainsWildcardNoMatch = function(test)
{
let expectations = {
parent: true,
middle: true,
inside: true,
sibling: true,
sibling2: true,
« 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