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

Unified Diff: test/filterClasses.js

Issue 29580558: Issue 5174 - Allow '{' and '}' in selectors (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Indent namespace content. Created Oct. 19, 2017, 12:48 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
« compiled/filter/ElemHideBase.cpp ('K') | « compiled/filter/ElemHideBase.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/filterClasses.js
===================================================================
--- a/test/filterClasses.js
+++ b/test/filterClasses.js
@@ -62,17 +62,17 @@
["#@#asdf", ElemHideException, "elemhideexception"],
["foobar##asdf", ElemHideFilter, "elemhide"],
["foobar#@#asdf", ElemHideException, "elemhideexception"],
["foobar##a", ElemHideFilter, "elemhide"],
["foobar#@#a", ElemHideException, "elemhideexception"],
["foobar#asdf", BlockingFilter, "blocking"],
["foobar|foobas##asdf", BlockingFilter, "blocking"],
- ["foobar##asdf{asdf}", BlockingFilter, "blocking"],
+ ["foobar##asdf{asdf}", ElemHideFilter, "elemhide"],
["foobar##", BlockingFilter, "blocking"],
["foobar#@#", BlockingFilter, "blocking"],
["asdf$foobar", InvalidFilter, "invalid"],
["asdf$image,foobar", InvalidFilter, "invalid"],
["asdf$image=foobar", BlockingFilter, "blocking"],
["asdf$image=foobar=xyz,~collapse", BlockingFilter, "blocking"],
["##foo[-abp-properties='something']bar", InvalidFilter, "invalid"],
@@ -376,16 +376,31 @@
{
doTest(text, selector, selectorDomain);
doTest(text.replace("##", "#@#"), selector, selectorDomain);
}
test.done();
};
+exports.testElemHideRulesWithBraces = function(test)
+{
+ let filter = Filter.fromText("###foo{color: red}");
+ test.equal(filter.type, "elemhide");
+ test.equal(filter.selector, "#foo\\7B color: red\\7D ");
+ filter.delete();
+
+ filter = Filter.fromText("foo.com##[-abp-properties='/margin: [3-4]{2}/']");
+ test.equal(filter.type, "elemhideemulation");
+ test.equal(filter.selector, "[-abp-properties='/margin: [3-4]\\7B 2\\7D /']");
+ filter.delete();
+
+ test.done();
+};
+
exports.testNotifications = function(test)
{
function checkNotifications(action, expected, message)
{
let result = null;
let listener = (topic, filter) =>
{
if (result)
« compiled/filter/ElemHideBase.cpp ('K') | « compiled/filter/ElemHideBase.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld