Tests: Import a bunch of WPT tests from /dom/events

This commit is contained in:
Andreas Kling
2024-11-17 11:29:31 +01:00
committed by Andreas Kling
parent 0339ece565
commit aa9ed71ff3
Notes: github-actions[bot] 2024-11-17 13:57:32 +00:00
125 changed files with 6002 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script type="text/javascript">
'use strict';
for (let eventType of ["MouseEvent", "KeyboardEvent", "WheelEvent", "FocusEvent"]) {
test(function() {
let before = performance.now();
let e = new window[eventType]('test');
let after = performance.now();
assert_greater_than_equal(e.timeStamp, before, "Event timestamp should be greater than performance.now() timestamp taken before its creation");
assert_less_than_equal(e.timeStamp, after, "Event timestamp should be less than performance.now() timestamp taken after its creation");
}, `Constructed ${eventType} timestamp should be high resolution and have the same time origin as performance.now()`);
}
</script>