Bug 1477240 [wpt PR 12091] - Clean up the battery-status IDL test, a=testonly
authorLuke Bjerring <lukebjerring@users.noreply.github.com>
Wed, 25 Jul 2018 18:01:10 +0000
changeset 429082 c78d9471dd64671ea66998ea860665f6db477cc5
parent 429081 2bbf71ce602e69b2fd4be33e3f5bf0040fe759cb
child 429083 2e4644d3bad6eee9decab1e1d5a8aa7c520b8fb0
push id34352
push userapavel@mozilla.com
push dateMon, 30 Jul 2018 09:52:49 +0000
treeherdermozilla-central@dead9fcddd4a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1477240, 12091
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 1477240 [wpt PR 12091] - Clean up the battery-status IDL test, a=testonly Automatic update from web-platform-testsClean up the battery-status IDL test (#12091) -- wpt-commits: 5fd123f7c4427320d01d5de0196043bb9dd9295d wpt-pr: 12091
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/battery-status/battery-interface-idlharness.https.html
testing/web-platform/tests/battery-status/battery-interface-idlharness.https.window.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -310870,19 +310870,19 @@
     ]
    ],
    "battery-status/battery-insecure-context.html": [
     [
      "/battery-status/battery-insecure-context.html",
      {}
     ]
    ],
-   "battery-status/battery-interface-idlharness.https.html": [
-    [
-     "/battery-status/battery-interface-idlharness.https.html",
+   "battery-status/battery-interface-idlharness.https.window.js": [
+    [
+     "/battery-status/battery-interface-idlharness.https.window.html",
      {}
     ]
    ],
    "battery-status/battery-promise-window.https.html": [
     [
      "/battery-status/battery-promise-window.https.html",
      {}
     ]
@@ -419337,18 +419337,18 @@
   "battery-status/battery-iframe.https.html": [
    "b4df9429c1ff9ace253fb40296b20c06f8eb5eb3",
    "testharness"
   ],
   "battery-status/battery-insecure-context.html": [
    "39639373d161846186cbcb7eb33466493bcc77ad",
    "testharness"
   ],
-  "battery-status/battery-interface-idlharness.https.html": [
-   "ded64d71b16ef29ee44ef2337642d551f8b557fe",
+  "battery-status/battery-interface-idlharness.https.window.js": [
+   "a95b16677ae52391ccd2d92b40eba679664c83bd",
    "testharness"
   ],
   "battery-status/battery-plugging-in-manual.https.html": [
    "1d7e354f498cf967bdf5dad3b2f696d7606dd3f6",
    "manual"
   ],
   "battery-status/battery-promise-window.https.html": [
    "47ee9801dd697228defd4e3be6a79ed6fe9af602",
deleted file mode 100644
--- a/testing/web-platform/tests/battery-status/battery-interface-idlharness.https.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE html>
-<meta charset="utf-8">
-<title>Battery test: IDL</title>
-<link rel="author" title="Intel" href="http://www.intel.com">
-<link rel="help" href="https://www.w3.org/TR/battery-status/">
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="/resources/WebIDLParser.js"></script>
-<script src="/resources/idlharness.js"></script>
-<script>
-'use strict';
-
-promise_test(async () => {
-  const battery = await fetch('/interfaces/battery-status.idl').then(r => r.text());
-  const dom = await fetch('/interfaces/dom.idl').then(r => r.text());
-  const html = await fetch('/interfaces/html.idl').then(r => r.text());
-
-  const idl_array = new IdlArray();
-  idl_array.add_idls(battery);
-  idl_array.add_dependency_idls(dom);
-  idl_array.add_dependency_idls(html);
-
-  let manager;
-  try {
-    manager = await navigator.getBattery();
-  } catch (e) {
-    // Will surface in idlharness.js's test_objects.
-  }
-
-  idl_array.add_objects({
-    Navigator: ['navigator'],
-    BatteryManager: [manager],
-  });
-  idl_array.test();
-}, 'Test IDL implementation of Battery Status API');
-</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/battery-status/battery-interface-idlharness.https.window.js
@@ -0,0 +1,20 @@
+// META: script=/resources/WebIDLParser.js
+// META: script=/resources/idlharness.js
+
+// https://w3c.github.io/battery/
+
+'use strict';
+
+idl_test(
+  ['battery'],
+  ['dom', 'html'],
+  async idl_array => {
+    idl_array.add_objects({
+      Navigator: ['navigator'],
+      BatteryManager: ['manager'],
+    })
+
+    self.manager = await navigator.getBattery();
+  },
+  'Test IDL implementation of Battery Status API'
+);