tor-browser

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

automatic-beacon-no-destination.https.html (1603B)


      1 <!DOCTYPE html>
      2 <title>Test window.fence.setReportEventDataForAutomaticBeacons</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    origin: get_host_info().HTTPS_REMOTE_ORIGIN
     22  });
     23 
     24  let beacon_event = {
     25    eventType: "reserved.top_navigation_commit",
     26    eventData: "This is the beacon data!",
     27    destination: ["component-seller"],
     28  };
     29  await setupAutomaticBeacon(fencedframe, [beacon_event]);
     30 
     31  await actions
     32    .pointerMove(0, 0, { origin: fencedframe.element })
     33    .pointerDown()
     34    .pointerUp()
     35    .send();
     36 
     37  // An automatic beacon should be sent out, but no data should be sent as part
     38  // of the beacon because the "buyer" destination was not specified in
     39  // setReportEventDataForAutomaticBeacons().
     40  await verifyBeaconData(beacon_event.eventType, "<No data>",
     41      get_host_info().HTTPS_REMOTE_ORIGIN);
     42 }, "Set and trigger an automatic beacon with no destination specified");
     43 
     44 </script>
     45 </body>