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

Unified Diff: test/browser/elemHideEmulation.js

Issue 29453590: Issue 5287 - Change syntax for element hiding emulation filters and remove simplified element hidin… (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created June 1, 2017, 12: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
Index: test/browser/elemHideEmulation.js
===================================================================
--- a/test/browser/elemHideEmulation.js
+++ b/test/browser/elemHideEmulation.js
@@ -113,72 +113,72 @@ function applyElemHideEmulation(selector
elemHideEmulation.apply();
return Promise.resolve();
}
exports.testVerbatimPropertySelector = function(test)
{
let toHide = createElementWithStyle("{background-color: #000}");
applyElemHideEmulation(
- ["[-abp-properties='background-color: rgb(0, 0, 0)']"]
+ [":-abp-properties(background-color: rgb(0, 0, 0))"]
).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)']"]
+ [":-abp-properties(*color: rgb(0, 0, 0))"]
).then(() =>
{
expectHidden(test, toHide);
}).catch(unexpectedError.bind(test)).then(() => test.done());
};
exports.testPropertySelectorWithRegularExpression = function(test)
{
let toHide = createElementWithStyle("{background-color: #000}");
applyElemHideEmulation(
- ["[-abp-properties='/.*color: rgb\\(0, 0, 0\\)/']"]
+ [":-abp-properties(/.*color: rgb\\(0, 0, 0\\)/)"]
).then(() =>
{
expectHidden(test, toHide);
}).catch(unexpectedError.bind(test)).then(() => test.done());
};
exports.testPropertySelectorWithEscapedBrace = function(test)
{
let toHide = createElementWithStyle("{background-color: #000}");
applyElemHideEmulation(
- ["[-abp-properties='/background.\\x7B 0,6\\x7D : rgb\\(0, 0, 0\\)/']"]
+ [":-abp-properties(/background.\\x7B 0,6\\x7D : rgb\\(0, 0, 0\\)/)"]
).then(() =>
{
expectHidden(test, toHide);
}).catch(unexpectedError.bind(test)).then(() => test.done());
};
exports.testPropertySelectorWithImproperlyEscapedBrace = function(test)
{
let toHide = createElementWithStyle("{background-color: #000}");
applyElemHideEmulation(
- ["[-abp-properties='/background.\\x7B0,6\\x7D: rgb\\(0, 0, 0\\)/']"]
+ [":-abp-properties(/background.\\x7B0,6\\x7D: rgb\\(0, 0, 0\\)/)"]
).then(() =>
{
expectVisible(test, toHide);
}).catch(unexpectedError.bind(test)).then(() => test.done());
};
exports.testDynamicallyChangedProperty = function(test)
{
let toHide = createElementWithStyle("{}");
applyElemHideEmulation(
- ["[-abp-properties='background-color: rgb(0, 0, 0)']"]
+ [":-abp-properties(background-color: rgb(0, 0, 0))"]
).then(() =>
{
expectVisible(test, toHide);
insertStyleRule("#" + toHide.id + " {background-color: #000}");
return new Promise((resolve, reject) =>
{
window.setTimeout(() =>
{
« no previous file with comments | « lib/filterClasses.js ('k') | test/domainRestrictions.js » ('j') | test/filterClasses.js » ('J')

Powered by Google App Engine
This is Rietveld