tor-browser

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

set-exceed-former-entry-limit.tentative.https.html (1847B)


      1 <!doctype html>
      2 <meta name="timeout" content="long">
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script src="/common/utils.js"></script>
      6 <script src="/shared-storage/resources/util.js"></script>
      7 <script src="/fenced-frame/resources/utils.js"></script>
      8 
      9 <body>
     10 <script>
     11 'use strict';
     12 const PREV_ENTRY_LIMIT = 10000;
     13 
     14 promise_test(async () => {
     15  const ancestor_key = token();
     16  let url0 = generateURL("/shared-storage/resources/frame0.html",
     17                         [ancestor_key]);
     18  let url1 = generateURL("/shared-storage/resources/frame1.html",
     19                         [ancestor_key]);
     20  let url2 = generateURL("/shared-storage/resources/frame2.html",
     21                         [ancestor_key]);
     22 
     23  const numEntriesToSet = PREV_ENTRY_LIMIT + 1;
     24 
     25  // Create an array of promises.
     26  const set_promises = [];
     27  for (let i = 0; i < numEntriesToSet; i++) {
     28    set_promises.push(sharedStorage.set(i.toString(), 'x'));
     29  }
     30 
     31  // Wait for all promises to resolve in parallel.
     32  await Promise.all(set_promises);
     33 
     34  await addModuleOnce("/shared-storage/resources/verify-length-module.js");
     35  let select_url_result = await sharedStorage.selectURL(
     36      "verify-length", [{url: url0}, {url: url1}, {url: url2}],
     37      {data: {'expectedLength': numEntriesToSet},
     38      resolveToConfig: true, keepAlive: true});
     39  assert_true(validateSelectURLResult(select_url_result, true));
     40  attachFencedFrame(select_url_result, 'opaque-ads');
     41 
     42  // frame1_loaded implies that the legnth is as expected and so the calls to
     43  // set() were all successful.
     44  assert_equals(await nextValueFromServer(ancestor_key), "frame1_loaded");
     45 
     46  // Clean up.
     47  await sharedStorage.clear();
     48 }, 'sharedStorage.set() is not constrained by the former entry limit of '
     49   + PREV_ENTRY_LIMIT.toString());
     50 
     51 </script>
     52 </body>