From 1a8eebc1a30ed1917fdddd7033b6e397c594c7df Mon Sep 17 00:00:00 2001 From: Hiroshige Hayashizaki Date: Mon, 2 Sep 2019 12:48:55 +0000 Subject: [PATCH] Bug 1566598 [wpt PR 17863] - Expose kv-storage built-in module only on SecureContexts, a=testonly Automatic update from web-platform-tests Expose kv-storage built-in module only on SecureContexts This CL adds actual restriction in Blink implementation. This CL also modifies tests and expectations to match with the current Blink built-in/import maps infra. A subtest in WPT test `import-statement.html` is failing because the current Blink implementation is based on pre-import-map spec and thus importing unavailable built-in causes fetch error. See 'import 'std:nonexistent';' row of https://github.com/WICG/import-maps/issues/159. Bug: 977470 Change-Id: I107f60ed95e1f91d62f468c29c5d741eef13f4f9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1702754 Commit-Queue: Hiroshige Hayashizaki Reviewed-by: Kouhei Ueno Cr-Commit-Position: refs/heads/master@{#691821} -- wpt-commits: cb808982deeb57212fb856858c1a7716d0ac2ecb wpt-pr: 17863 --- .../kv-storage/secure-context/import-maps.html | 6 +++--- .../kv-storage/secure-context/import-statement.html | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/testing/web-platform/tests/kv-storage/secure-context/import-maps.html b/testing/web-platform/tests/kv-storage/secure-context/import-maps.html index 64301f03032c0..211b9e43b1f18 100644 --- a/testing/web-platform/tests/kv-storage/secure-context/import-maps.html +++ b/testing/web-platform/tests/kv-storage/secure-context/import-maps.html @@ -15,7 +15,7 @@ diff --git a/testing/web-platform/tests/kv-storage/secure-context/import-statement.html b/testing/web-platform/tests/kv-storage/secure-context/import-statement.html index db01152a4e155..71e14b04e3144 100644 --- a/testing/web-platform/tests/kv-storage/secure-context/import-statement.html +++ b/testing/web-platform/tests/kv-storage/secure-context/import-statement.html @@ -13,13 +13,14 @@ assert_false(self.isSecureContext, "This test must run in a non-secure context"); }, "Prerequisite check"); -async_test(t => { - window.addEventListener("error", t.step_func_done(errorEvent => { - assert_equals(errorEvent.error.constructor, TypeError, "Must trigger a TypeError"); - }, { once: true })); -}); +const t = async_test('Static import kv-storage in non-secure context'); + +window.addEventListener("error", t.step_func_done(errorEvent => { + assert_equals(errorEvent.error.constructor, TypeError, "Must trigger a TypeError"); +}, { once: true })); -