From efc86d5c43409d824f4616e2d07dcd44825621e1 Mon Sep 17 00:00:00 2001 From: rwaldron Date: Thu, 14 Sep 2023 15:44:54 -0400 Subject: [PATCH] Enable shadowrealm testing for streams api Starting with tests that don't have additional dependencies. --- streams/piping/general-addition.any.js | 2 +- streams/piping/throwing-options.any.js | 2 +- streams/piping/transform-streams.any.js | 2 +- streams/queuing-strategies.any.js | 2 +- streams/readable-byte-streams/bad-buffers-and-views.any.js | 2 +- .../readable-byte-streams/enqueue-with-detached-buffer.any.js | 2 +- streams/readable-byte-streams/non-transferable-buffers.any.js | 2 +- streams/readable-byte-streams/respond-after-enqueue.any.js | 2 +- streams/readable-streams/bad-strategies.any.js | 2 +- streams/readable-streams/bad-underlying-sources.any.js | 2 +- streams/readable-streams/constructor.any.js | 2 +- .../readable-streams/count-queuing-strategy-integration.any.js | 2 +- streams/readable-streams/floating-point-total-queue-size.any.js | 2 +- streams/readable-streams/patched-global.any.js | 2 +- streams/transferable/transform-stream-members.any.js | 1 + streams/transform-streams/errors.any.js | 2 +- streams/transform-streams/lipfuzz.any.js | 2 +- streams/transform-streams/patched-global.any.js | 2 +- streams/transform-streams/properties.any.js | 2 +- streams/writable-streams/bad-strategies.any.js | 2 +- streams/writable-streams/byte-length-queuing-strategy.any.js | 2 +- streams/writable-streams/constructor.any.js | 2 +- streams/writable-streams/count-queuing-strategy.any.js | 2 +- streams/writable-streams/error.any.js | 2 +- streams/writable-streams/floating-point-total-queue-size.any.js | 2 +- streams/writable-streams/general.any.js | 2 +- streams/writable-streams/properties.any.js | 2 +- 27 files changed, 27 insertions(+), 26 deletions(-) diff --git a/streams/piping/general-addition.any.js b/streams/piping/general-addition.any.js index 2562b7064338ee..cf4aa9bea6a1a4 100644 --- a/streams/piping/general-addition.any.js +++ b/streams/piping/general-addition.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; promise_test(async t => { diff --git a/streams/piping/throwing-options.any.js b/streams/piping/throwing-options.any.js index b9f906778f632b..186f8ded1968a4 100644 --- a/streams/piping/throwing-options.any.js +++ b/streams/piping/throwing-options.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; class ThrowingOptions { diff --git a/streams/piping/transform-streams.any.js b/streams/piping/transform-streams.any.js index caae9fbad8848a..e079bb637cad0d 100644 --- a/streams/piping/transform-streams.any.js +++ b/streams/piping/transform-streams.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; promise_test(() => { diff --git a/streams/queuing-strategies.any.js b/streams/queuing-strategies.any.js index fa959ebba28338..9efc4570cf2ee2 100644 --- a/streams/queuing-strategies.any.js +++ b/streams/queuing-strategies.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; const highWaterMarkConversions = new Map([ diff --git a/streams/readable-byte-streams/bad-buffers-and-views.any.js b/streams/readable-byte-streams/bad-buffers-and-views.any.js index 3322116b191840..afcc61e6800a28 100644 --- a/streams/readable-byte-streams/bad-buffers-and-views.any.js +++ b/streams/readable-byte-streams/bad-buffers-and-views.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; promise_test(() => { diff --git a/streams/readable-byte-streams/enqueue-with-detached-buffer.any.js b/streams/readable-byte-streams/enqueue-with-detached-buffer.any.js index d2b37f00a9d697..92bd0a26a0ec05 100644 --- a/streams/readable-byte-streams/enqueue-with-detached-buffer.any.js +++ b/streams/readable-byte-streams/enqueue-with-detached-buffer.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm promise_test(async t => { const error = new Error('cannot proceed'); diff --git a/streams/readable-byte-streams/non-transferable-buffers.any.js b/streams/readable-byte-streams/non-transferable-buffers.any.js index e8ea3c4f966763..47d7b2e653e5ec 100644 --- a/streams/readable-byte-streams/non-transferable-buffers.any.js +++ b/streams/readable-byte-streams/non-transferable-buffers.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; promise_test(async t => { diff --git a/streams/readable-byte-streams/respond-after-enqueue.any.js b/streams/readable-byte-streams/respond-after-enqueue.any.js index b93cec97391e13..e51efa061a6511 100644 --- a/streams/readable-byte-streams/respond-after-enqueue.any.js +++ b/streams/readable-byte-streams/respond-after-enqueue.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; diff --git a/streams/readable-streams/bad-strategies.any.js b/streams/readable-streams/bad-strategies.any.js index 409c63b8177e25..49fa4bdbece5b5 100644 --- a/streams/readable-streams/bad-strategies.any.js +++ b/streams/readable-streams/bad-strategies.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; test(() => { diff --git a/streams/readable-streams/bad-underlying-sources.any.js b/streams/readable-streams/bad-underlying-sources.any.js index e9cf4c924930b2..3d77b923d178a0 100644 --- a/streams/readable-streams/bad-underlying-sources.any.js +++ b/streams/readable-streams/bad-underlying-sources.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; diff --git a/streams/readable-streams/constructor.any.js b/streams/readable-streams/constructor.any.js index 608dc48cfa39d7..0b995f0cb16bde 100644 --- a/streams/readable-streams/constructor.any.js +++ b/streams/readable-streams/constructor.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; const error1 = new Error('error1'); diff --git a/streams/readable-streams/count-queuing-strategy-integration.any.js b/streams/readable-streams/count-queuing-strategy-integration.any.js index 02ac5bae5c2f8a..a8c1b91d0068e3 100644 --- a/streams/readable-streams/count-queuing-strategy-integration.any.js +++ b/streams/readable-streams/count-queuing-strategy-integration.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; test(() => { diff --git a/streams/readable-streams/floating-point-total-queue-size.any.js b/streams/readable-streams/floating-point-total-queue-size.any.js index 50cca3d951a942..8b88c21d7f0b53 100644 --- a/streams/readable-streams/floating-point-total-queue-size.any.js +++ b/streams/readable-streams/floating-point-total-queue-size.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; // Due to the limitations of floating-point precision, the calculation of desiredSize sometimes gives different answers diff --git a/streams/readable-streams/patched-global.any.js b/streams/readable-streams/patched-global.any.js index a64a054a97f1f5..c208824c864469 100644 --- a/streams/readable-streams/patched-global.any.js +++ b/streams/readable-streams/patched-global.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; // Tests which patch the global environment are kept separate to avoid diff --git a/streams/transferable/transform-stream-members.any.js b/streams/transferable/transform-stream-members.any.js index fca060b0c05fa3..06716fe9faa314 100644 --- a/streams/transferable/transform-stream-members.any.js +++ b/streams/transferable/transform-stream-members.any.js @@ -1,3 +1,4 @@ +// META: global=window,dedicatedworker,shadowrealm const combinations = [ (t => [t, t.readable])(new TransformStream()), (t => [t.readable, t])(new TransformStream()), diff --git a/streams/transform-streams/errors.any.js b/streams/transform-streams/errors.any.js index 0cca4c75479d6d..678234cc738789 100644 --- a/streams/transform-streams/errors.any.js +++ b/streams/transform-streams/errors.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm // META: script=../resources/test-utils.js 'use strict'; diff --git a/streams/transform-streams/lipfuzz.any.js b/streams/transform-streams/lipfuzz.any.js index f9f148aaf1c6a4..e334705db44354 100644 --- a/streams/transform-streams/lipfuzz.any.js +++ b/streams/transform-streams/lipfuzz.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; class LipFuzzTransformer { diff --git a/streams/transform-streams/patched-global.any.js b/streams/transform-streams/patched-global.any.js index 2d04e3b948b324..cc111eda452f0f 100644 --- a/streams/transform-streams/patched-global.any.js +++ b/streams/transform-streams/patched-global.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; // Tests which patch the global environment are kept separate to avoid diff --git a/streams/transform-streams/properties.any.js b/streams/transform-streams/properties.any.js index 02981b8bc76a5f..dbfd1aa372b907 100644 --- a/streams/transform-streams/properties.any.js +++ b/streams/transform-streams/properties.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; const transformerMethods = { diff --git a/streams/writable-streams/bad-strategies.any.js b/streams/writable-streams/bad-strategies.any.js index 63fa443065ee41..a1ef0791168f99 100644 --- a/streams/writable-streams/bad-strategies.any.js +++ b/streams/writable-streams/bad-strategies.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; const error1 = new Error('a unique string'); diff --git a/streams/writable-streams/byte-length-queuing-strategy.any.js b/streams/writable-streams/byte-length-queuing-strategy.any.js index ce1962e8917f32..eed86ee7004ea1 100644 --- a/streams/writable-streams/byte-length-queuing-strategy.any.js +++ b/streams/writable-streams/byte-length-queuing-strategy.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; promise_test(t => { diff --git a/streams/writable-streams/constructor.any.js b/streams/writable-streams/constructor.any.js index eaac90e48b8f86..0abc7ef545ea0b 100644 --- a/streams/writable-streams/constructor.any.js +++ b/streams/writable-streams/constructor.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; const error1 = new Error('error1'); diff --git a/streams/writable-streams/count-queuing-strategy.any.js b/streams/writable-streams/count-queuing-strategy.any.js index 064e16e81506f1..8211757530d323 100644 --- a/streams/writable-streams/count-queuing-strategy.any.js +++ b/streams/writable-streams/count-queuing-strategy.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; test(() => { diff --git a/streams/writable-streams/error.any.js b/streams/writable-streams/error.any.js index faf3fdd9521430..d08c8a54863bb9 100644 --- a/streams/writable-streams/error.any.js +++ b/streams/writable-streams/error.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; const error1 = new Error('error1'); diff --git a/streams/writable-streams/floating-point-total-queue-size.any.js b/streams/writable-streams/floating-point-total-queue-size.any.js index bd34cc53a69579..20a14fc19a51e0 100644 --- a/streams/writable-streams/floating-point-total-queue-size.any.js +++ b/streams/writable-streams/floating-point-total-queue-size.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; // Due to the limitations of floating-point precision, the calculation of desiredSize sometimes gives different answers diff --git a/streams/writable-streams/general.any.js b/streams/writable-streams/general.any.js index cede7fd0845b74..48f8eeb89e41ee 100644 --- a/streams/writable-streams/general.any.js +++ b/streams/writable-streams/general.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; test(() => { diff --git a/streams/writable-streams/properties.any.js b/streams/writable-streams/properties.any.js index c95bd7d0c080ba..ae0549f0871b48 100644 --- a/streams/writable-streams/properties.any.js +++ b/streams/writable-streams/properties.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker +// META: global=window,worker,shadowrealm 'use strict'; const sinkMethods = {