mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
Tests: Import a bunch of WPT tests from /dom/events
This commit is contained in:
committed by
Andreas Kling
parent
0339ece565
commit
aa9ed71ff3
Notes:
github-actions[bot]
2024-11-17 13:57:32 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/aa9ed71ff34 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2394
@@ -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>
|
||||
Reference in New Issue
Block a user