tor-browser

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

fence-report-event.https.html (907B)


      1 <!DOCTYPE html>
      2 <title>Test window.fence.reportEvent</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 
      9 <body>
     10 <script>
     11 promise_test(async(t) => {
     12  const fencedframe = await attachFencedFrameContext({generator_api: 'fledge'});
     13  await fencedframe.execute(() => {
     14    let event = {};
     15    assert_throws_js(TypeError, () => {window.fence.reportEvent(event);});
     16 
     17    event.eventType = "click";
     18    assert_throws_js(TypeError, () => {window.fence.reportEvent(event);});
     19 
     20    event.eventData = "dummy";
     21    assert_throws_js(TypeError, () => {window.fence.reportEvent(event);});
     22 
     23    event.destination = ["buyer"];
     24    window.fence.reportEvent(event);
     25  });
     26 }, 'window.fence.reportEvent');
     27 </script>
     28 </body>