From a7d64faa7effaa0f675baf062eec96735e3d7514 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Wed, 1 Apr 2020 13:20:04 +0000 Subject: [PATCH] Bug 1624254 [wpt PR 22385] - HTML: use Wasm to get a SharedArrayBuffer instance, a=testonly Automatic update from web-platform-tests HTML: use Wasm to get a SharedArrayBuffer instance And verify that the SharedArrayBuffer constructor isn't exposed without COOP+COEP. For https://github.com/web-platform-tests/wpt/issues/22358. -- wpt-commits: 288c95a86dd02d0fe28bbfd49a2ee0a7801faa43 wpt-pr: 22385 UltraBlame original commit: 149839b40bf29217aee70e9e6326568db5c2b926 --- .../no-coop-coep.https.any.js | 89 ++++++++++++++++++- .../serialization-via-idb.any.js | 56 ++++++++++-- ...serialization-via-notifications-api.any.js | 56 ++++++++++-- .../requires-failure.https.any.js | 18 +++- .../requires-success.any.js | 18 +++- 5 files changed, 214 insertions(+), 23 deletions(-) diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-coop-coep.https.any.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-coop-coep.https.any.js index 71e5299a66cec..b858eb61cbc10 100644 --- a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-coop-coep.https.any.js +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-coop-coep.https.any.js @@ -5,13 +5,66 @@ test = > { +assert_equals +( +globalThis +. +SharedArrayBuffer +undefined +) +; +assert_false +( +" +SharedArrayBuffer +" +in +globalThis +) +; +} +" +SharedArrayBuffer +constructor +does +not +exist +without +COOP ++ +COEP +" +) +; +test +( +( +) += +> +{ const sab = new -SharedArrayBuffer +WebAssembly +. +Memory ( +{ +shared +: +true +initial +: +1 +maximum +: +1 +} ) +. +buffer ; const channel @@ -63,9 +116,24 @@ const sab = new -SharedArrayBuffer +WebAssembly +. +Memory ( +{ +shared +: +true +initial +: +1 +maximum +: +1 +} ) +. +buffer ; const channel @@ -131,9 +199,24 @@ const sab = new -SharedArrayBuffer +WebAssembly +. +Memory ( +{ +shared +: +true +initial +: +1 +maximum +: +1 +} ) +. +buffer ; assert_throws_dom ( diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-idb.any.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-idb.any.js index ba046248fae46..67189908fcd75 100644 --- a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-idb.any.js +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-idb.any.js @@ -53,6 +53,29 @@ key } ) ; +const +sab += +new +WebAssembly +. +Memory +( +{ +shared +: +true +initial +: +1 +maximum +: +1 +} +) +. +buffer +; assert_throws_dom ( " @@ -73,10 +96,7 @@ key 1 property : -new -SharedArrayBuffer -( -) +sab } ) ; @@ -153,6 +173,29 @@ key } ) ; +const +sab += +new +WebAssembly +. +Memory +( +{ +shared +: +true +initial +: +1 +maximum +: +1 +} +) +. +buffer +; let getter1Called = @@ -199,10 +242,7 @@ return ; } } -new -SharedArrayBuffer -( -) +sab { get x diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-notifications-api.any.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-notifications-api.any.js index 1054270bc4f64..769c3fce8983b 100644 --- a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-notifications-api.any.js +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-notifications-api.any.js @@ -20,6 +20,29 @@ DataCloneError = > { +const +sab += +new +WebAssembly +. +Memory +( +{ +shared +: +true +initial +: +1 +maximum +: +1 +} +) +. +buffer +; new Notification ( @@ -31,10 +54,7 @@ Hi { data : -new -SharedArrayBuffer -( -) +sab } ) ; @@ -65,6 +85,29 @@ test = > { +const +sab += +new +WebAssembly +. +Memory +( +{ +shared +: +true +initial +: +1 +maximum +: +1 +} +) +. +buffer +; let getter1Called = @@ -112,10 +155,7 @@ return ; } } -new -SharedArrayBuffer -( -) +sab { get x diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-agent-formalism/requires-failure.https.any.js b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-agent-formalism/requires-failure.https.any.js index c026634e5773d..479c7d6133b48 100644 --- a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-agent-formalism/requires-failure.https.any.js +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-agent-formalism/requires-failure.https.any.js @@ -9,10 +9,24 @@ const sab = new -SharedArrayBuffer +WebAssembly +. +Memory ( -16 +{ +shared +: +true +initial +: +1 +maximum +: +1 +} ) +. +buffer ; const ta diff --git a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-agent-formalism/requires-success.any.js b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-agent-formalism/requires-success.any.js index 70e69366c231f..5c0ad02e82996 100644 --- a/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-agent-formalism/requires-success.any.js +++ b/testing/web-platform/tests/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-agent-formalism/requires-success.any.js @@ -9,10 +9,24 @@ const sab = new -SharedArrayBuffer +WebAssembly +. +Memory ( -16 +{ +shared +: +true +initial +: +1 +maximum +: +1 +} ) +. +buffer ; const ta