summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/streams/readable-streams/cross-realm-crash.window.js
blob: 5fc7ce37a5f6d2dbd90b5f898bcd7b198f0c50b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// This is a repro for a crash bug that existed in Blink. See
// https://crbug.com/1290014. If there's no crash then the test passed.

test(t => {
  const iframeTag = document.createElement('iframe');
  document.body.appendChild(iframeTag);

  const readableStream = new ReadableStream();
  const reader = new iframeTag.contentWindow.ReadableStreamDefaultReader(readableStream);
  iframeTag.remove();
  reader.cancel();
  reader.read();
}, 'should not crash on reading from stream cancelled in destroyed realm');