tor-browser

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

automatic-beacon-shared-storage.https.html (1797B)


      1 <!DOCTYPE html>
      2 <title>Test window.fence.setReportEventDataForAutomaticBeacons from
      3    SharedStorage</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/common/utils.js"></script>
      7 <script src="/common/dispatcher/dispatcher.js"></script>
      8 <script src="resources/utils.js"></script>
      9 <script src="/resources/testdriver.js"></script>
     10 <script src="/resources/testdriver-actions.js"></script>
     11 <script src="/resources/testdriver-vendor.js"></script>
     12 <script src="/common/get-host-info.sub.js"></script>
     13 <script src="resources/automatic-beacon-helper.js"></script>
     14 
     15 <body>
     16 <script>
     17 promise_test(async(t) => {
     18  const actions = new test_driver.Actions();
     19  const fencedframe = await attachFencedFrameContext(
     20      {generator_api: 'sharedstorage',
     21       origin: get_host_info().HTTPS_REMOTE_ORIGIN,
     22       register_beacon: true});
     23 
     24  let start_event = {
     25    eventType: "reserved.top_navigation_start",
     26    eventData: "This is the start beacon data!",
     27    destination: ["shared-storage-select-url"],
     28  }
     29  let commit_event = {
     30    eventType: "reserved.top_navigation_commit",
     31    eventData: "This is the commit beacon data!",
     32    destination: ["shared-storage-select-url"],
     33  }
     34  await setupAutomaticBeacon(fencedframe, [start_event, commit_event]);
     35 
     36  await actions.pointerMove(0, 0, {origin: fencedframe.element})
     37               .pointerDown()
     38               .pointerUp()
     39               .send();
     40 
     41  await verifyBeaconData(start_event.eventType, start_event.eventData,
     42      get_host_info().HTTPS_REMOTE_ORIGIN);
     43  await verifyBeaconData(commit_event.eventType, commit_event.eventData,
     44      get_host_info().HTTPS_REMOTE_ORIGIN);
     45 }, 'Set and trigger an automatic beacon in a click handler for SharedStorage');
     46 
     47 </script>
     48 </body>