summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/streams/transferable/transform-stream-members.any.js
blob: 05914e12ccbe574ffe006cb35dab0ec717828b5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// META: global=window,dedicatedworker,shadowrealm

const combinations = [
  (t => [t, t.readable])(new TransformStream()),
  (t => [t.readable, t])(new TransformStream()),
  (t => [t, t.writable])(new TransformStream()),
  (t => [t.writable, t])(new TransformStream()),
];

for (const combination of combinations) {
  test(() => {
    assert_throws_dom(
      "DataCloneError",
      () => structuredClone(combination, { transfer: combination }),
      "structuredClone should throw"
    );
  }, `Transferring ${combination} should fail`);
}