summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/service-workers/service-worker/resources/partitioned-cookies-3p-window.html
blob: 8e90609da22fcd87e90a2c4fe9b7561d9ba525de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<head>
<meta charset="utf-8"/>
<meta name="timeout" content="long">
<title>Service Worker: Partitioned Cookies 3P Window</title>
<script src="/resources/testharness.js"></script>
</head>

<body>
<script>

promise_test(async t => {
  assert_true(
      location.search.includes('origin='), 'First party origin passed');
  const first_party_origin = decodeURIComponent(
      location.search.split('origin=')[1]);
  const iframe = document.createElement('iframe');
  iframe.src = new URL(
      './partitioned-cookies-3p-frame.html',
      first_party_origin + location.pathname).href;
  document.body.appendChild(iframe);
  fetch_tests_from_window(iframe.contentWindow);

  const credentialless_frame = document.createElement('iframe');
  credentialless_frame.credentialless = true;
  credentialless_frame.src = new URL(
      './partitioned-cookies-3p-credentialless-frame.html',
      first_party_origin + location.pathname).href;
  document.body.appendChild(credentialless_frame);
  fetch_tests_from_window(credentialless_frame.contentWindow);
});

</script>
</body>
</html>