diff --git a/testing/web-platform/tests/pointerevents/compat/pointerevent_mouse-on-object.html b/testing/web-platform/tests/pointerevents/compat/pointerevent_mouse-on-object.html new file mode 100644 index 000000000000..d8912a2652b4 --- /dev/null +++ b/testing/web-platform/tests/pointerevents/compat/pointerevent_mouse-on-object.html @@ -0,0 +1,64 @@ + + + + + + + + + + +

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(); + }); +}