Bug 1446228 [wpt PR 10063] - Indexed DB: Consolidate window/worker IDL tests into any.js, a=testonly
authorJoshua Bell <jsbell@chromium.org>
Mon, 09 Apr 2018 17:26:11 +0000
changeset 467128 f1393a4742d7a7baf7db5d4b70214a24cb3c2cd7
parent 467127 3e3811f90abf18ed19d3eda86760f32305331f62
child 467129 40988d36ce19d8cea8452f76a20602bdabdd47ad
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1446228, 10063, 965452, 544429
milestone61.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 1446228 [wpt PR 10063] - Indexed DB: Consolidate window/worker IDL tests into any.js, a=testonly Automatic update from web-platform-testsIndexed DB: Consolidate window/worker IDL tests into any.js Also, rely on HTML and DOM interfaces for dependencies rather than inline definitions for Event, EventTarget, etc. Change-Id: I58ac6515f8d2769aec6bbf1b90d9a4105639ad24 Reviewed-on: https://chromium-review.googlesource.com/965452 Reviewed-by: Philip J├Ągenstedt <foolip@chromium.org> Commit-Queue: Joshua Bell <jsbell@chromium.org> Cr-Commit-Position: refs/heads/master@{#544429} wpt-commits: dacfb4465c26ab8ee6e1e618671b38905b50c02e wpt-pr: 10063 wpt-commits: dacfb4465c26ab8ee6e1e618671b38905b50c02e wpt-pr: 10063
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/IndexedDB/interfaces.any.js
testing/web-platform/tests/IndexedDB/interfaces.html
testing/web-platform/tests/IndexedDB/interfaces.worker.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -305676,25 +305676,23 @@
     ]
    ],
    "IndexedDB/index_sort_order.htm": [
     [
      "/IndexedDB/index_sort_order.htm",
      {}
     ]
    ],
-   "IndexedDB/interfaces.html": [
-    [
-     "/IndexedDB/interfaces.html",
-     {}
-    ]
-   ],
-   "IndexedDB/interfaces.worker.js": [
-    [
-     "/IndexedDB/interfaces.worker.html",
+   "IndexedDB/interfaces.any.js": [
+    [
+     "/IndexedDB/interfaces.any.html",
+     {}
+    ],
+    [
+     "/IndexedDB/interfaces.any.worker.html",
      {}
     ]
    ],
    "IndexedDB/interleaved-cursors-large.html": [
     [
      "/IndexedDB/interleaved-cursors-large.html",
      {
       "timeout": "long"
@@ -397215,22 +397213,18 @@
   "IndexedDB/idbworker.js": [
    "03e244d70d286d726bf0a227bc36ef1b4d8bcc72",
    "support"
   ],
   "IndexedDB/index_sort_order.htm": [
    "251a828d333bdd3face9d20a2a28ddf0c0ffeb49",
    "testharness"
   ],
-  "IndexedDB/interfaces.html": [
-   "348a7350d749c4ea11d383d1f3e07e54a9d0d377",
-   "testharness"
-  ],
-  "IndexedDB/interfaces.worker.js": [
-   "a74350d69819f73cf9f75ac636f8793f018ba2fd",
+  "IndexedDB/interfaces.any.js": [
+   "df07f5da63c34969a24fe43bc4268418ab0a5132",
    "testharness"
   ],
   "IndexedDB/interleaved-cursors-common.js": [
    "6744105fe1a15a91058e3e5993f8a1f88548e3a3",
    "support"
   ],
   "IndexedDB/interleaved-cursors-large.html": [
    "4ee13538a407fe15fe310c8776d84c7526b7b363",
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/IndexedDB/interfaces.any.js
@@ -0,0 +1,32 @@
+// META: script=/resources/WebIDLParser.js
+// META: script=/resources/idlharness.js
+
+promise_test(async t => {
+  const [html, dom, indexeddb] = await Promise.all([
+    '/interfaces/html.idl',
+    '/interfaces/dom.idl',
+    '/interfaces/IndexedDB.idl',
+  ].map(url => fetch(url).then(response => response.text())));
+
+  const idl_array = new IdlArray();
+  idl_array.add_untested_idls('interface LinkStyle {};');  // Needed by html
+  idl_array.add_untested_idls(html);
+  idl_array.add_untested_idls(dom);
+  idl_array.add_idls(indexeddb);
+  idl_array.add_objects({
+    IDBCursor: [],
+    IDBCursorWithValue: [],
+    IDBDatabase: [],
+    IDBFactory: [self.indexedDB],
+    IDBIndex: [],
+    IDBKeyRange: [IDBKeyRange.only(0)],
+    IDBObjectStore: [],
+    IDBOpenDBRequest: [],
+    IDBRequest: [],
+    IDBTransaction: [],
+    IDBVersionChangeEvent: [new IDBVersionChangeEvent('')],
+    DOMStringList: [],
+  });
+
+  idl_array.test();
+}, 'Test driver');
deleted file mode 100644
--- a/testing/web-platform/tests/IndexedDB/interfaces.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!doctype html>
-<meta charset=utf-8>
-<title>IndexedDB IDL tests</title>
-<script src=/resources/testharness.js></script>
-<script src=/resources/testharnessreport.js></script>
-<script src=/resources/WebIDLParser.js></script>
-<script src=/resources/idlharness.js></script>
-
-<h1>IndexedDB IDL tests</h1>
-<div id=log></div>
-
-<script>
-"use strict";
-async_test(function(t) {
-  var request = new XMLHttpRequest();
-  request.open("GET", "/interfaces/IndexedDB.idl");
-  request.send();
-  request.onload = t.step_func(function() {
-    var idlArray = new IdlArray();
-    var idls = request.responseText;
-
-    // https://html.spec.whatwg.org/multipage/browsers.html#window
-    idlArray.add_untested_idls("[Global=Window, Exposed=Window] interface Window { };");
-
-    // https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope-mixin
-    idlArray.add_untested_idls(`[NoInterfaceObject, Exposed=(Window,Worker)]
-                                interface WindowOrWorkerGlobalScope {};`);
-    idlArray.add_untested_idls("Window implements WindowOrWorkerGlobalScope;");
-
-    // https://dom.spec.whatwg.org/#interface-event
-    idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface Event { };");
-
-    // https://dom.spec.whatwg.org/#interface-eventtarget
-    idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface EventTarget { };");
-
-    // https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#domstringlist
-    idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface DOMStringList { };");
-
-    // From Indexed DB:
-    idlArray.add_idls(idls);
-
-    idlArray.add_objects({
-      IDBCursor: [],
-      IDBCursorWithValue: [],
-      IDBDatabase: [],
-      IDBFactory: ["window.indexedDB"],
-      IDBIndex: [],
-      IDBKeyRange: ["IDBKeyRange.only(0)"],
-      IDBObjectStore: [],
-      IDBOpenDBRequest: [],
-      IDBRequest: [],
-      IDBTransaction: [],
-      IDBVersionChangeEvent: ["new IDBVersionChangeEvent('foo')"],
-      DOMStringList: [],
-    });
-
-    idlArray.test();
-    t.done();
-  });
-});
-</script>
deleted file mode 100644
--- a/testing/web-platform/tests/IndexedDB/interfaces.worker.js
+++ /dev/null
@@ -1,53 +0,0 @@
-"use strict";
-
-importScripts("/resources/testharness.js");
-importScripts("/resources/WebIDLParser.js", "/resources/idlharness.js");
-
-async_test(function(t) {
-  var request = new XMLHttpRequest();
-  request.open("GET", "/interfaces/IndexedDB.idl");
-  request.send();
-  request.onload = t.step_func(function() {
-    var idlArray = new IdlArray();
-    var idls = request.responseText;
-
-    // https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope
-    idlArray.add_untested_idls("[Exposed=Worker] interface WorkerGlobalScope {};");
-
-    // https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope-mixin
-    idlArray.add_untested_idls(`[NoInterfaceObject, Exposed=(Window,Worker)]
-                              interface WindowOrWorkerGlobalScope {};`);
-    idlArray.add_untested_idls("WorkerGlobalScope implements WindowOrWorkerGlobalScope;");
-
-    // https://dom.spec.whatwg.org/#interface-event
-    idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface Event { };");
-
-    // https://dom.spec.whatwg.org/#interface-eventtarget
-    idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface EventTarget { };");
-
-    // https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#domstringlist
-    idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface DOMStringList { };");
-
-    // From Indexed DB:
-    idlArray.add_idls(idls);
-
-    idlArray.add_objects({
-      IDBCursor: [],
-      IDBCursorWithValue: [],
-      IDBDatabase: [],
-      IDBFactory: ["self.indexedDB"],
-      IDBIndex: [],
-      IDBKeyRange: ["IDBKeyRange.only(0)"],
-      IDBObjectStore: [],
-      IDBOpenDBRequest: [],
-      IDBRequest: [],
-      IDBTransaction: [],
-      IDBVersionChangeEvent: ["new IDBVersionChangeEvent('foo')"],
-      DOMStringList: [],
-    });
-    idlArray.test();
-    t.done();
-  });
-});
-
-done();