tor-browser

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

test_ppa_disabled_detectable.html (1073B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 
      4 <head>
      5  <meta charset="utf-8">
      6  <title>PPA Throws for Invalid Source or Target Domains</title>
      7  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      8  <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
      9 </head>
     10 
     11 <body>
     12 <script>
     13  add_task(async function testSaveImpressionThrowsWithInvalidTarget() {
     14    try {
     15      navigator.privateAttribution.saveImpression({
     16        type: "view",
     17        index: 6,
     18        ad: "ad_id",
     19        target: "~"
     20      });
     21      ok(false, "saveImpression did not throw");
     22    } catch(e) {
     23      ok(true, "saveImpression throws:" + e);
     24    }
     25  });
     26 
     27  add_task(async function testMeasureConversionThrowsWithInvalidSource() {
     28    try {
     29      navigator.privateAttribution.measureConversion({
     30        task: "task_id",
     31        histogramSize: 5,
     32        lookbackDays: 30,
     33        impression: "view",
     34        ads: ["ad_id"],
     35        sources: ["~"]
     36      })
     37      ok(false, "measureConversion did not throw");
     38    } catch(e) {
     39      ok(true, "measureConversion throws:" + e);
     40    }
     41  });
     42 </script>
     43 </body>
     44 
     45 </html>