@@ -319,6 +319,23 @@ for (const type of bufferSourceConstructors) {
319
319
320
320
commonNotOk ( allowResizableSUT ) ;
321
321
} ) ;
322
+
323
+ describe ( "with [AllowShared, AllowResizable]" , ( ) => {
324
+ const allowSharedAndResizableSUT = ( v , opts ) => {
325
+ return conversions [ typeName ] ( v , { ...opts , allowShared : true , allowResizable : true } ) ;
326
+ } ;
327
+
328
+ for ( const { label, creator, typeName : innerTypeName , isDetached, isForged } of bufferSourceCreators ) {
329
+ const testFunction = innerTypeName === typeName &&
330
+ ! isDetached &&
331
+ ! isForged ?
332
+ testOk :
333
+ testNotOk ;
334
+ testFunction ( label , allowSharedAndResizableSUT , creator ) ;
335
+ }
336
+
337
+ commonNotOk ( allowSharedAndResizableSUT ) ;
338
+ } ) ;
322
339
} ) ;
323
340
}
324
341
@@ -415,6 +432,26 @@ describe("WebIDL ArrayBufferView type", () => {
415
432
416
433
commonNotOk ( allowResizableSUT ) ;
417
434
} ) ;
435
+
436
+ describe ( "with [AllowShared, AllowResizable]" , ( ) => {
437
+ const allowResizableSUT = ( v , opts ) => {
438
+ return conversions . ArrayBufferView ( v , { ...opts , allowShared : true , allowResizable : true } ) ;
439
+ } ;
440
+
441
+ for ( const { label, creator, typeName, isDetached, isForged } of bufferSourceCreators ) {
442
+ const testFunction =
443
+ typeName !== "ArrayBuffer" &&
444
+ typeName !== "SharedArrayBuffer" &&
445
+ ! isDetached &&
446
+ ! isForged ?
447
+ testOk :
448
+ testNotOk ;
449
+
450
+ testFunction ( label , allowResizableSUT , creator ) ;
451
+ }
452
+
453
+ commonNotOk ( allowResizableSUT ) ;
454
+ } ) ;
418
455
} ) ;
419
456
420
457
describe ( "WebIDL BufferSource type" , ( ) => {
@@ -448,4 +485,17 @@ describe("WebIDL BufferSource type", () => {
448
485
449
486
commonNotOk ( allowResizableSUT ) ;
450
487
} ) ;
488
+
489
+ describe ( "with [AllowShared, AllowResizable]" , ( ) => {
490
+ const allowResizableSUT = ( v , opts ) => {
491
+ return conversions . BufferSource ( v , { ...opts , allowShared : true , allowResizable : true } ) ;
492
+ } ;
493
+
494
+ for ( const { label, creator, isDetached, isForged } of bufferSourceCreators ) {
495
+ const testFunction = ! isDetached && ! isForged ? testOk : testNotOk ;
496
+ testFunction ( label , allowResizableSUT , creator ) ;
497
+ }
498
+
499
+ commonNotOk ( allowResizableSUT ) ;
500
+ } ) ;
451
501
} ) ;
0 commit comments