tor-browser

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

automatic-beacon-cross-origin-no-data.https.html (1852B)


      1 <!DOCTYPE html>
      2 <title>Test cross-origin automatic beacons without data</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script src="/common/utils.js"></script>
      6 <script src="/common/dispatcher/dispatcher.js"></script>
      7 <script src="resources/utils.js"></script>
      8 <script src="/resources/testdriver.js"></script>
      9 <script src="/resources/testdriver-actions.js"></script>
     10 <script src="/resources/testdriver-vendor.js"></script>
     11 <script src="/common/get-host-info.sub.js"></script>
     12 <script src="resources/automatic-beacon-helper.js"></script>
     13 
     14 <body>
     15 <script>
     16 promise_test(async(t) => {
     17  const actions = new test_driver.Actions();
     18  const fencedframe = await attachFencedFrameContext({
     19    generator_api: 'fledge',
     20    register_beacon: true
     21  });
     22  const new_url = new URL("resources/close.html", location.href);
     23 
     24  // Add a fenced frame that does not set automatic beacon data.
     25  await fencedframe.execute(async (new_url) => {
     26    // Add a cross-origin iframe that will perform the top-level navigation.
     27    const iframe = await attachIFrameContext({
     28      origin: get_host_info().HTTPS_REMOTE_ORIGIN,
     29      headers: [['Allow-Fenced-Frame-Automatic-Beacons', 'true']],
     30    });
     31    await iframe.execute(async (new_url) => {
     32      addEventListener("click", (event) => {
     33        window.open(new_url);
     34      });
     35    }, [new_url]);
     36  }, [new_url]);
     37 
     38  await actions.pointerMove(0, 0, {origin: fencedframe.element})
     39      .pointerDown()
     40      .pointerUp()
     41      .send();
     42 
     43  await verifyBeaconData("reserved.top_navigation_start", "<No data>",
     44      get_host_info().HTTPS_REMOTE_ORIGIN);
     45  await verifyBeaconData("reserved.top_navigation_commit", "<No data>",
     46      get_host_info().HTTPS_REMOTE_ORIGIN);
     47 }, 'Automatic beacon in a cross-origin subframe with no beacon data set');
     48 </script>
     49 </body>