Skip to content

Commit 210f6b4

Browse files
committed
test: update WPT for hr-time to 6b16e87e48
1 parent 9ff27fd commit 210f6b4

File tree

7 files changed

+54
-11
lines changed

7 files changed

+54
-11
lines changed

test/fixtures/wpt/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ Last update:
1515
- console: https://github.com/web-platform-tests/wpt/tree/e48251b778/console
1616
- dom/abort: https://github.com/web-platform-tests/wpt/tree/dc928169ee/dom/abort
1717
- dom/events: https://github.com/web-platform-tests/wpt/tree/0a811c5161/dom/events
18-
- encoding: https://github.com/web-platform-tests/wpt/tree/1ac8deee08/encoding
18+
- encoding: https://github.com/web-platform-tests/wpt/tree/0dc50adc2e/encoding
1919
- fetch/data-urls/resources: https://github.com/web-platform-tests/wpt/tree/7c79d998ff/fetch/data-urls/resources
2020
- FileAPI: https://github.com/web-platform-tests/wpt/tree/7f51301888/FileAPI
21-
- hr-time: https://github.com/web-platform-tests/wpt/tree/34cafd797e/hr-time
21+
- hr-time: https://github.com/web-platform-tests/wpt/tree/6b16e87e48/hr-time
2222
- html/webappapis/atob: https://github.com/web-platform-tests/wpt/tree/f267e1dca6/html/webappapis/atob
2323
- html/webappapis/microtask-queuing: https://github.com/web-platform-tests/wpt/tree/2c5c3c4c27/html/webappapis/microtask-queuing
2424
- html/webappapis/structured-clone: https://github.com/web-platform-tests/wpt/tree/47d3fb280c/html/webappapis/structured-clone
@@ -27,13 +27,13 @@ Last update:
2727
- performance-timeline: https://github.com/web-platform-tests/wpt/tree/94caab7038/performance-timeline
2828
- resource-timing: https://github.com/web-platform-tests/wpt/tree/22d38586d0/resource-timing
2929
- resources: https://github.com/web-platform-tests/wpt/tree/1d2c5fb36a/resources
30-
- streams: https://github.com/web-platform-tests/wpt/tree/bc9dcbbf1a/streams
30+
- streams: https://github.com/web-platform-tests/wpt/tree/894c8d4858/streams
3131
- url: https://github.com/web-platform-tests/wpt/tree/c928b19ab0/url
3232
- urlpattern: https://github.com/web-platform-tests/wpt/tree/a2e15ad405/urlpattern
3333
- user-timing: https://github.com/web-platform-tests/wpt/tree/5ae85bf826/user-timing
3434
- wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/cde25e7e3c/wasm/jsapi
3535
- wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi
36-
- web-locks: https://github.com/web-platform-tests/wpt/tree/10a122a6bc/web-locks
36+
- web-locks: https://github.com/web-platform-tests/wpt/tree/0633bb21ad/web-locks
3737
- WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/c9e955840a/WebCryptoAPI
3838
- webidl: https://github.com/web-platform-tests/wpt/tree/63ca529a02/webidl
3939
- webidl/ecmascript-binding/es-exceptions: https://github.com/web-platform-tests/wpt/tree/2f96fa1996/webidl/ecmascript-binding/es-exceptions
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
features:
2+
- name: performance
3+
files: "**"

test/fixtures/wpt/hr-time/idlharness-shadowrealm.window.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

test/fixtures/wpt/hr-time/idlharness.any.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// META: global=window,worker
1+
// META: global=window,worker,shadowrealm-in-window
22
// META: script=/resources/WebIDLParser.js
33
// META: script=/resources/idlharness.js
44
// META: timeout=long
@@ -11,6 +11,10 @@ idl_test(
1111
['hr-time'],
1212
['html', 'dom'],
1313
async idl_array => {
14+
if (self.GLOBAL.isShadowRealm()) {
15+
return;
16+
}
17+
1418
if (self.GLOBAL.isWorker()) {
1519
idl_array.add_objects({ WorkerGlobalScope: ['self'] });
1620
} else {
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<link rel="help" href="https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering">
5+
<script src="/resources/testharness.js"></script>
6+
<script src="/resources/testharnessreport.js"></script>
7+
</head>
8+
<body>
9+
<script>
10+
/* Coarsen to 5 microseconds or coarser */
11+
const COARSE_RESOLUTION = 0.005;
12+
13+
const CUSTOM_TIMELINE_DELTA = 0.002;
14+
const FLOATING_POINT_ERROR_EPSILON = 0.01;
15+
16+
// Note that this test would fail if the platform introduces a jitter.
17+
// It is recommended that platforms that implement jitter run this test
18+
// with a flag that turns jitter off, if possible.
19+
20+
const customTimeline = new DocumentTimeline({originTime: CUSTOM_TIMELINE_DELTA});
21+
promise_test(async t => {
22+
for (let i = 0; i < 32; ++i) {
23+
const timestamp = await new Promise(resolve => requestAnimationFrame(ts => resolve(ts)));
24+
const coarse_timestamp = Math.round(timestamp / COARSE_RESOLUTION) * COARSE_RESOLUTION;
25+
assert_approx_equals(timestamp, coarse_timestamp, FLOATING_POINT_ERROR_EPSILON,
26+
"timestamp should be coarsened");
27+
assert_approx_equals(timestamp, document.timeline.currentTime, FLOATING_POINT_ERROR_EPSILON,
28+
"document.timeline.currentTimeline should be the same as the rAF callback");
29+
assert_approx_equals(customTimeline.currentTime + CUSTOM_TIMELINE_DELTA,
30+
timestamp, FLOATING_POINT_ERROR_EPSILON,
31+
"originTime for custom timeline should not be coarsened");
32+
}
33+
});
34+
</script>
35+
</body>
36+
</html>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Cross-Origin-Embedder-Policy: require-corp
2+
Cross-Origin-Opener-Policy: same-origin

test/fixtures/wpt/versions.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"path": "dom/events"
2121
},
2222
"encoding": {
23-
"commit": "1ac8deee082ecfb5d3b6f9c56cf9d1688a2fc218",
23+
"commit": "0dc50adc2e989134defaea66aacff377ab940543",
2424
"path": "encoding"
2525
},
2626
"fetch/data-urls/resources": {
@@ -32,7 +32,7 @@
3232
"path": "FileAPI"
3333
},
3434
"hr-time": {
35-
"commit": "34cafd797e58dad280d20040eee012d49ccfa91f",
35+
"commit": "6b16e87e48e6f91ac2e3c91f925b125a342f5ae8",
3636
"path": "hr-time"
3737
},
3838
"html/webappapis/atob": {
@@ -68,7 +68,7 @@
6868
"path": "resources"
6969
},
7070
"streams": {
71-
"commit": "bc9dcbbf1a4c2c741ef47f47d6ede6458f40c4a4",
71+
"commit": "894c8d48583be8721f8f712400929baeb9a8782f",
7272
"path": "streams"
7373
},
7474
"url": {
@@ -92,7 +92,7 @@
9292
"path": "wasm/webapi"
9393
},
9494
"web-locks": {
95-
"commit": "10a122a6bc3670a44e0fa8b9a99f6aa9012d30f1",
95+
"commit": "0633bb21ad37f95809b4dc04b8c7d56e9df5ad40",
9696
"path": "web-locks"
9797
},
9898
"WebCryptoAPI": {

0 commit comments

Comments
 (0)