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: Snippet is now type 1 Created April 18, 2019, 2:47 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
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)
+{
Manish Jethani 2019/04/18 08:40:43 I really don't think this is generic enough to kee
hub 2019/04/18 17:48:40 Done.
+ 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;

Powered by Google App Engine
This is Rietveld