tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

window-simple-success.https.html (2547B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>Structured cloning of SharedArrayBuffers: simple success cases that don't need dedicated files</title>
      4 <link rel="help" href="https://html.spec.whatwg.org/multipage/#structuredserialize">
      5 <link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <script src="resources/test-incrementer.js"></script>
      9 
     10 <div id="log"></div>
     11 
     12 <script>
     13 "use strict";
     14 
     15 [
     16  "DataView",
     17  "Int8Array",
     18  "Uint8Array",
     19  "Uint8ClampedArray",
     20  "Int16Array",
     21  "Uint16Array",
     22  "Int32Array",
     23  "Uint32Array",
     24  "BigInt64Array",
     25  "BigUint64Array",
     26  "Float16Array",
     27  "Float32Array",
     28  "Float64Array"
     29 ].forEach(type => {
     30  promise_test(t => {
     31    const worker = new Worker("resources/incrementer-worker.js");
     32 
     33    return testSharingViaIncrementerScript(t, worker, "window", worker, "worker", undefined, type);
     34  }, "postMessaging to a dedicated worker allows them to see each others' modifications with " + type);
     35 });
     36 
     37 promise_test(t => {
     38  return new Promise(resolve => {
     39    const iframe = document.createElement("iframe");
     40    iframe.onload = t.step_func(() => {
     41      resolve(testSharingViaIncrementerScript(t, window, "window", iframe.contentWindow, "iframe", "*"));
     42    });
     43    iframe.src = "resources/incrementer-iframe.html";
     44    document.body.appendChild(iframe);
     45  });
     46 }, "postMessaging to a same-origin iframe allows them to see each others' modifications");
     47 
     48 promise_test(t => {
     49  return new Promise(resolve => {
     50    const iframe = document.createElement("iframe");
     51    iframe.onload = t.step_func(() => {
     52      const level1 = iframe.contentWindow;
     53      const level2 = level1.frames[0];
     54      const level3 = level2.frames[0];
     55      const targetWindow = level3.frames[0];
     56      resolve(testSharingViaIncrementerScript(t, window, "window", targetWindow, "nested iframe", "*"));
     57    });
     58    iframe.src = "resources/nested-iframe-1.html";
     59    document.body.appendChild(iframe);
     60  });
     61 }, "postMessaging to a same-origin deeply-nested iframe allows them to see each others' modifications");
     62 
     63 promise_test(t => {
     64  return new Promise(resolve => {
     65    const w = window.open("resources/incrementer-popup.html");
     66    w.onload = t.step_func(() => {
     67      resolve(testSharingViaIncrementerScript(t, window, "window", w, "popup window", "*").then(() => {
     68        w.close();
     69      }));
     70    });
     71  });
     72 }, "postMessaging to a same-origin opened window allows them to see each others' modifications");
     73 </script>