Update the hr-time IDL file + test (#11862)
diff --git a/hr-time/idlharness.any.js b/hr-time/idlharness.any.js
new file mode 100644
index 0000000..4e266c0
--- /dev/null
+++ b/hr-time/idlharness.any.js
@@ -0,0 +1,22 @@
+// META: global=window,worker
+// META: script=/resources/WebIDLParser.js
+// META: script=/resources/idlharness.js
+
+'use strict';
+
+// https://w3c.github.io/hr-time/
+
+idl_test(
+ ['hr-time'],
+ ['html', 'dom'],
+ async idl_array => {
+ if (self.GLOBAL.isWorker()) {
+ idl_array.add_objects({ WorkerGlobalScope: ['self'] });
+ } else {
+ idl_array.add_objects({ Window: ['self'] });
+ }
+ idl_array.add_objects({
+ Performance: ['performance'],
+ });
+ }
+);
diff --git a/hr-time/idlharness.html b/hr-time/idlharness.html
deleted file mode 100644
index d28cee3..0000000
--- a/hr-time/idlharness.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<title>High Resolution Time IDL tests</title>
-<link rel="author" title="W3C" href="http://www.w3.org/" />
-<link rel="help" href="http://www.w3.org/TR/hr-time/#sec-extenstions-performance-interface"/>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="/resources/WebIDLParser.js"></script>
-<script src="/resources/idlharness.js"></script>
-</head>
-<body>
-<h1>High Resolution Time IDL tests</h1>
-<div id="log"></div>
-<script>
-'use strict';
-
-function doTest([dom, html, hr_time]) {
- var idl_array = new IdlArray();
- idl_array.add_untested_idls(dom, { only: ['EventTarget'] });
- idl_array.add_untested_idls(html, { only: ['WindowOrWorkerGlobalScope'] });
- idl_array.add_idls(hr_time);
- idl_array.add_objects({
- Performance: ["window.performance"],
- Window: ["window"],
- });
- idl_array.test();
-}
-
-function fetchText(url) {
- return fetch(url).then((response) => response.text());
-}
-
-promise_test(() => {
- return Promise.all(['/interfaces/dom.idl',
- '/interfaces/html.idl',
- '/interfaces/hr-time.idl'].map(fetchText))
- .then(doTest);
-}, 'Test driver');
-</script>
-</body>
-</html>
diff --git a/interfaces/hr-time.idl b/interfaces/hr-time.idl
index 3c793c3..ca15cf8 100644
--- a/interfaces/hr-time.idl
+++ b/interfaces/hr-time.idl
@@ -1,17 +1,18 @@
// GENERATED CONTENT - DO NOT EDIT
-// Content of this file was automatically extracted from the High Resolution Time spec.
-// See https://w3c.github.io/hr-time/
+// Content of this file was automatically extracted from the
+// "High Resolution Time Level 2" spec.
+// See: https://w3c.github.io/hr-time/
typedef double DOMHighResTimeStamp;
[Exposed=(Window,Worker)]
interface Performance : EventTarget {
- DOMHighResTimeStamp now ();
+ DOMHighResTimeStamp now();
readonly attribute DOMHighResTimeStamp timeOrigin;
[Default] object toJSON();
};
-partial interface WindowOrWorkerGlobalScope {
+partial interface mixin WindowOrWorkerGlobalScope {
[Replaceable]
readonly attribute Performance performance;
};