Verifies that mouse activities on an object fire pointerevents. It expected to get pointerup when the pointerdown happened on the object for compatibility with flash objects.
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/pointerevents/pointerevent_support.js b/testing/web-platform/tests/pointerevents/pointerevent_support.js
index 48f9eb301767..8dbedf21686c 100644
--- a/testing/web-platform/tests/pointerevents/pointerevent_support.js
+++ b/testing/web-platform/tests/pointerevents/pointerevent_support.js
@@ -379,3 +379,16 @@ function moveToDocument(pointerType) {
.pointerMove(0, 0)
.send();
}
+
+// Returns a promise that only gets resolved when the condition is met.
+function resolveWhen(condition) {
+ return new Promise((resolve, reject) => {
+ function tick() {
+ if (condition())
+ resolve();
+ else
+ requestAnimationFrame(tick.bind(this));
+ }
+ tick();
+ });
+}