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

Unified Diff: test/browser/_utils.js

Issue 30024560: Issue 7450 - Implement hide-if-contains-visible-text snippet (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: a couple of jsdocs fixes Created April 18, 2019, 12:19 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/snippets.js ('k') | test/browser/elemHideEmulation.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/browser/_utils.js
===================================================================
--- a/test/browser/_utils.js
+++ b/test/browser/_utils.js
@@ -21,8 +21,34 @@
{
return new Promise(resolve =>
{
setTimeout(resolve, delay);
});
}
exports.timeout = timeout;
+
+function expectHidden(test, element, id)
+{
+ let withId = "";
+ if (typeof id != "undefined")
+ withId = ` with ID '${id}'`;
+
+ test.equal(
+ window.getComputedStyle(element).display, "none",
+ `The element${withId}'s display property should be set to 'none'`);
+}
+
+exports.expectHidden = expectHidden;
+
+function expectVisible(test, element, id)
+{
+ let withId = "";
+ if (typeof id != "undefined")
+ withId = ` with ID '${id}'`;
+
+ test.notEqual(
+ window.getComputedStyle(element).display, "none",
+ `The element${withId}'s display property should not be set to 'none'`);
+}
+
+exports.expectVisible = expectVisible;
« no previous file with comments | « lib/content/snippets.js ('k') | test/browser/elemHideEmulation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld