Bug 1482283 [wpt PR 12390] - Rewrite Budget API IDL test to use idl_test, a=testonly
authorPhilip Jägenstedt <philip@foolip.org>
Wed, 15 Aug 2018 09:55:19 +0000
changeset 486830 01c5f20f69f23fde79f2c14c9c3a26563d8aae11
parent 486829 b9960e439b126ba89d8154452bb42e287a52a9f7
child 486831 7b50355d1de053a38f32386bd640a8c4c5f032f7
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1482283, 12390
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1482283 [wpt PR 12390] - Rewrite Budget API IDL test to use idl_test, a=testonly Automatic update from web-platform-testsRewrite Budget API IDL test to use idl_test (#12390) -- wpt-commits: 13f24abbc0da9d73ede59516bb6289592ff94216 wpt-pr: 12390
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/budget-api/idlharness.https.any.js
testing/web-platform/tests/budget-api/interfaces.any.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -323723,23 +323723,23 @@
    "bluetooth/service/getCharacteristics/gen-service-is-removed.https.html": [
     [
      "/bluetooth/service/getCharacteristics/gen-service-is-removed.https.html",
      {
       "testdriver": true
      }
     ]
    ],
-   "budget-api/interfaces.any.js": [
-    [
-     "/budget-api/interfaces.any.html",
-     {}
-    ],
-    [
-     "/budget-api/interfaces.any.worker.html",
+   "budget-api/idlharness.https.any.js": [
+    [
+     "/budget-api/idlharness.https.any.html",
+     {}
+    ],
+    [
+     "/budget-api/idlharness.https.any.worker.html",
      {}
     ]
    ],
    "clear-site-data/executionContexts.sub.html": [
     [
      "/clear-site-data/executionContexts.sub.html",
      {}
     ]
@@ -432570,18 +432570,18 @@
   "bluetooth/service/getCharacteristics/gen-service-is-removed.https.html": [
    "4868127465adfe8ec405d843de9fc115d725c280",
    "testharness"
   ],
   "budget-api/META.yml": [
    "6cc0000f6ff7547e1b1bc635cbd0cabf0754675a",
    "support"
   ],
-  "budget-api/interfaces.any.js": [
-   "5a87b3f8a2f42627063cfbb9a79e8b0cd63d63e8",
+  "budget-api/idlharness.https.any.js": [
+   "335c7a60a4dc8daecd3a2b28b86438698ac06484",
    "testharness"
   ],
   "check_stability.ini": [
    "b939328be1cb69c3dcc47495930ba0df28b2bad2",
    "support"
   ],
   "clear-site-data/META.yml": [
    "65ca96dbb9d774e97cc3a60f6b6dde952104893b",
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/budget-api/idlharness.https.any.js
@@ -0,0 +1,24 @@
+// META: script=/resources/WebIDLParser.js
+// META: script=/resources/idlharness.js
+
+'use strict';
+
+// See https://wicg.github.io/budget-api/
+
+idl_test(
+  ['budget-api'],
+  ['html'],
+  async idl_array => {
+    idl_array.add_objects({ BudgetService: ['navigator.budget'] });
+    if (self.Window) {
+      idl_array.add_objects({ Navigator: ['navigator'] });
+    } else {
+      idl_array.add_objects({ WorkerNavigator: ['navigator'] });
+    }
+    const budgetStates = await navigator.budget.getBudget();
+    if (budgetStates.length) {
+      self.budgetState = budgetStates[0];
+      idl_array.add_objects({ BudgetState: ['budgetState'] });
+    }
+  }
+);
deleted file mode 100644
--- a/testing/web-platform/tests/budget-api/interfaces.any.js
+++ /dev/null
@@ -1,19 +0,0 @@
-// META: script=/resources/WebIDLParser.js
-// META: script=/resources/idlharness.js
-
-'use strict';
-
-// See https://wicg.github.io/budget-api/
-
-promise_test(async () => {
-  const html = await fetch('/interfaces/html.idl').then(r => r.text());
-  const workers = await fetch('/interfaces/dedicated-workers.idl').then(r => r.text());
-  const idl = await fetch('/interfaces/budget-api.idl').then(r => r.text());
-
-  const idlArray = new IdlArray();
-  idlArray.add_idls(idl);
-  idlArray.add_dependency_idls(html);
-  idlArray.add_dependency_idls(workers);
-  idlArray.test();
-  done();
-}, 'budget-api interfaces.');