Bug 1474854 [wpt PR 11908] - Update user-timing IDL + test, a=testonly
authorLuke Bjerring <lukebjerring@users.noreply.github.com>
Wed, 25 Jul 2018 17:59:34 +0000
changeset 824114 9bb88f00fc953856bcd35b81a3fb94ec83d7b19f
parent 824113 e2c29d369524c5d2bc57f98c4a5122c7bfe2de73
child 824115 03db2839465e8df65eb10e78857e9b5bc0fdb8cd
push id117837
push userbmo:aryx.bugmail@gmx-topmail.de
push dateMon, 30 Jul 2018 09:42:15 +0000
reviewerstestonly
bugs1474854, 11908
milestone63.0a1
Bug 1474854 [wpt PR 11908] - Update user-timing IDL + test, a=testonly Automatic update from web-platform-testsUpdate user-timing IDL + test (#11908) -- wpt-commits: 072ed09628fd75a7daaee2d6722748ff5633ddf8 wpt-pr: 11908
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/interfaces/user-timing.idl
testing/web-platform/tests/user-timing/idlharness.any.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -592434,17 +592434,17 @@
    "872f7b943e89660d3491bcb176dd1976ce21dc0f",
    "support"
   ],
   "interfaces/url.idl": [
    "642e1ec46c8e57b579900f7cd10e99a8f80d552e",
    "support"
   ],
   "interfaces/user-timing.idl": [
-   "41c00eec8e9c1b2137bd05e85bdc029b7a87c349",
+   "e91a31115b596326e55da3c9ccd141b2b5e7275a",
    "support"
   ],
   "interfaces/vibration.idl": [
    "2cac333a4dcdb11d56a4457a31941d924911853d",
    "support"
   ],
   "interfaces/wake-lock.idl": [
    "62ca49757b1cc22c4e61f4910b156815ce4ec720",
@@ -621890,17 +621890,17 @@
    "6759560cec2edbefa2e552ba86a0336d9d2274e7",
    "testharness"
   ],
   "user-timing/entry_type.any.js": [
    "bb08ac2ee06bc12e75cc44b76f06d3f0262f44ba",
    "testharness"
   ],
   "user-timing/idlharness.any.js": [
-   "6a0dcd26b5ff16b18603c50b9257d55e6e25f0ce",
+   "62a3040dfb0508df0ef9d572a33e750cdd2b0d18",
    "testharness"
   ],
   "user-timing/invoke_with_timing_attributes.html": [
    "05283be9a7230ba0c4af09fb5dac98d828bfaf2e",
    "testharness"
   ],
   "user-timing/invoke_with_timing_attributes.worker.js": [
    "f86e2132ced139cfe712a20ee4f64ba9e44459d2",
--- a/testing/web-platform/tests/interfaces/user-timing.idl
+++ b/testing/web-platform/tests/interfaces/user-timing.idl
@@ -1,19 +1,19 @@
 // GENERATED CONTENT - DO NOT EDIT
 // Content of this file was automatically extracted from the
 // "User Timing Level 2" spec.
 // See: https://w3c.github.io/user-timing/
 
 partial interface Performance {
     void mark(DOMString markName);
     void clearMarks(optional DOMString markName);
-    void measure(DOMString measureName,
-                 optional DOMString startMark,
-                 optional DOMString endMark);
+    void measure(DOMString measureName, optional DOMString startMark, optional DOMString endMark);
     void clearMeasures(optional DOMString measureName);
 };
+
 [Exposed=(Window,Worker)]
 interface PerformanceMark : PerformanceEntry {
 };
+
 [Exposed=(Window,Worker)]
 interface PerformanceMeasure : PerformanceEntry {
 };
--- a/testing/web-platform/tests/user-timing/idlharness.any.js
+++ b/testing/web-platform/tests/user-timing/idlharness.any.js
@@ -1,24 +1,32 @@
 // META: global=window,worker
 // META: script=/resources/WebIDLParser.js
 // META: script=/resources/idlharness.js
 
 // https://w3c.github.io/user-timing/
 
 'use strict';
 
-promise_test(async () => {
-  const idl_array = new IdlArray();
-  const idl = await fetch("/interfaces/user-timing.idl").then(r => r.text());
-  const hrtime = await fetch("/interfaces/hr-time.idl").then(r => r.text());
-  const perf = await fetch("/interfaces/performance-timeline.idl").then(r => r.text());
-  const dom = await fetch("/interfaces/dom.idl").then(r => r.text());
+idl_test(
+  ['user-timing'],
+  ['hr-time', 'performance-timeline', 'dom'],
+  idl_array => {
+    try {
+      performance.mark('test');
+      performance.measure('test');
+      for (const m of performance.getEntriesByType('mark')) {
+        self.mark = m;
+      }
+      for (const m of performance.getEntriesByType('measure')) {
+        self.measure = m;
+      }
+    } catch (e) {
+      // Will be surfaced when mark is undefined below.
+    }
 
-  idl_array.add_idls(idl);
-  idl_array.add_dependency_idls(hrtime);
-  idl_array.add_dependency_idls(perf);
-  idl_array.add_dependency_idls(dom);
-  idl_array.add_objects({
-    Performance: ["performance"]
-  });
-  idl_array.test();
-}, "Test IDL implementation of user-timing API");
+    idl_array.add_objects({
+      Performance: ['performance'],
+      PerformanceMark: ['mark'],
+      PerformanceMeasure: ['measure'],
+    });
+  },
+  'Test IDL implementation of user-timing API');