tor-browser

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

combined-setters-and-operations.tentative.https.sub.html (1959B)


      1 <!doctype html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <script src="/common/utils.js"></script>
      5 <script src="/shared-storage/resources/util.js"></script>
      6 <script src="/fenced-frame/resources/utils.js"></script>
      7 
      8 <body>
      9 <script>
     10 'use strict';
     11 
     12 for (const resolve_to_config of [true, false]) {
     13  promise_test(async () => {
     14    const ancestor_key = token();
     15    let url0 = generateURL("/shared-storage/resources/frame0.html",
     16                           [ancestor_key]);
     17    let url1 = generateURL("/shared-storage/resources/frame1.html",
     18                           [ancestor_key]);
     19    let url2 = generateURL("/shared-storage/resources/frame2.html",
     20                           [ancestor_key]);
     21 
     22    await sharedStorage.set('key0-set-from-document', 'value0');
     23    await addModuleOnce(
     24        "/shared-storage/resources/verify-storage-entries-module.js");
     25    await sharedStorage.run("set-key0-operation", {keepAlive: true});
     26 
     27    let select_url_result = await sharedStorage.selectURL(
     28        "verify-storage-entries-url-selection-operation",
     29        [{url: url0,
     30          reportingMetadata: {'click':
     31                              "/shared-storage/resources/frame0.html"}},
     32         {url: url1,
     33          reportingMetadata:
     34            {'mouse interaction': "/shared-storage/resources/frame1.html",
     35            'click': "/shared-storage/resources/frame2.html"}}],
     36        {resolveToConfig: resolve_to_config, keepAlive: resolve_to_config});
     37 
     38    assert_true(validateSelectURLResult(select_url_result, resolve_to_config));
     39    attachFencedFrame(select_url_result, 'opaque-ads');
     40 
     41    // frame1_loaded implies that the setters and the operations were successful.
     42    assert_equals(await nextValueFromServer(ancestor_key), "frame1_loaded");
     43 
     44  }, 'verify-storage-entries-url-selection-operation selectURL() resolves to ' +
     45     (resolve_to_config ? 'config' : 'urn:uuid'));
     46 }
     47 
     48 </script>
     49 </body>