summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fetch/api/request/multi-globals/construct-in-detached-frame.window.js
blob: b0d6ba5b80db821ee75b3892626369caa6e3aece (plain)
1
2
3
4
5
6
7
8
9
10
11
// This is a regression test for Chromium issue https://crbug.com/1427266.
test(() => {
  const iframe = document.createElement('iframe');
  document.body.append(iframe);
  const otherRequest = iframe.contentWindow.Request;
  iframe.remove();
  const r1 = new otherRequest('resource', { method: 'POST', body: 'string' });
  const r2 = new otherRequest(r1);
  assert_true(r1.bodyUsed);
  assert_false(r2.bodyUsed);
}, 'creating a request from another request in a detached realm should work');