From 3b6ee74efd5dfd80729f56dd7e5e033e2d85bcea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20J=C3=A4genstedt?= Date: Wed, 15 Aug 2018 01:01:12 +0000 Subject: [PATCH] Bug 1482241 [wpt PR 12386] - Rewrite secure-contexts/idlharness.any.js to use idl_test, a=testonly Automatic update from web-platform-testsRewrite secure-contexts/idlharness.any.js to use idl_test (#12386) Fixes https://github.com/web-platform-tests/wpt/issues/12378, by adding the right depencies and the right global object depending on context. -- wpt-commits: d125b8f074d63d145f2b2f52262283add46bbc04 wpt-pr: 12386 --- testing/web-platform/meta/MANIFEST.json | 2 +- .../tests/secure-contexts/idlharness.any.js | 23 +++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json index 654e0f12f617..898b1186c938 100644 --- a/testing/web-platform/meta/MANIFEST.json +++ b/testing/web-platform/meta/MANIFEST.json @@ -627518,7 +627518,7 @@ "testharness" ], "secure-contexts/idlharness.any.js": [ - "88341f3b215dd80a164d4144a13ecdf74c1d4ef5", + "5bd1d44d6f7d9c299ff41c241802652924ce77b2", "testharness" ], "secure-contexts/postMessage-helper.html": [ diff --git a/testing/web-platform/tests/secure-contexts/idlharness.any.js b/testing/web-platform/tests/secure-contexts/idlharness.any.js index 88341f3b215d..5bd1d44d6f7d 100644 --- a/testing/web-platform/tests/secure-contexts/idlharness.any.js +++ b/testing/web-platform/tests/secure-contexts/idlharness.any.js @@ -6,15 +6,14 @@ 'use strict'; -promise_test(async () => { - const idl = await fetch("/interfaces/secure-contexts.idl").then(r => r.text()); - const workers = await fetch("/interfaces/dedicated-workers.idl").then(r => r.text()); - - const idl_array = new IdlArray(); - idl_array.add_idls(idl); - idl_array.add_dependency_idls(workers); - idl_array.add_objects({ - WindowOrWorkerGlobalScope: ["self"], - }); - idl_array.test(); -}, "Test IDL implementation of Secure Contexts"); +idl_test( + ['secure-contexts'], + ['html', 'dom'], + idl_array => { + if (self.Window) { + idl_array.add_objects({ Window: ['self'] }); + } else { + idl_array.add_objects({ WorkerGlobalScope: ['self'] }); + } + } +);