tor-browser

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

opaque-ad-sizes-special-cases.https.html (1410B)


      1 <!DOCTYPE html>
      2 <title>Test frame size restrictions in FLEDGE.</title>
      3 <meta name="timeout" content="long">
      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/opaque-ad-sizes-utils.js"></script>
     10 
     11 <body>
     12 <script>
     13 
     14 // Rounding cases.
     15 promise_test(async () => { return runOpaqueAdSizesTest(970.1, 250, 970, 250); }, '970.1x250');
     16 promise_test(async () => { return runOpaqueAdSizesTest(970, 250.1, 970, 250); }, '970x250.1');
     17 promise_test(async () => { return runOpaqueAdSizesTest(971, 250, 970, 250); }, '971x250');
     18 promise_test(async () => { return runOpaqueAdSizesTest(970, 251, 970, 250); }, '970x251');
     19 
     20 // Edge cases. The particular sizes it rounds to aren't important here, just
     21 // that it rounds to one of the sizes on the allowed list.
     22 promise_test(async () => { return runOpaqueAdSizesTest(0, 100, 320, 50); }, '0x100');
     23 promise_test(async () => { return runOpaqueAdSizesTest(100, 0, 320, 50); }, '100x0');
     24 promise_test(async () => { return runOpaqueAdSizesTest(Number.MAX_VALUE, Number.MAX_VALUE, 300, 250); }, 'MAXxMAX');
     25 promise_test(async () => { return runOpaqueAdSizesTest(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, 320, 100); }, 'INFINITYxINFINITY');
     26 </script>
     27 </body>