tor-browser

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

promise.html (1109B)


      1 <!DOCTYPE html>
      2 <head>
      3  <script src="/resources/testharness.js"></script>
      4  <script src="/resources/testharnessreport.js"></script>
      5  <script src="/common/get-host-info.sub.js"></script>
      6  <script src="../../resources/test-initiator.js"></script>
      7 
      8  <script src="../../resources/loading-resource-lib.js"></script>
      9 </head>
     10 <body>
     11  <h1>Description</h1>
     12  <p> This test verifies that, for a resource fetched with a Promise,
     13      the initiator_url points to the async caller script,
     14      instead of the callee script.
     15  </p>
     16 </body>
     17 <script>
     18  var img = document.createElement("img");
     19  document.body.appendChild(img);
     20 
     21  const label = "initiator_url_promise";
     22  const resource = "/images/blue.png?"+label;
     23  const hostInfo = get_host_info();
     24  const expectedInitiatorUrl = hostInfo["ORIGIN"] +
     25    "/resource-timing/tentative/initiator-url/promise.html";
     26  const instant_promise = Promise.resolve();
     27  instant_promise.then( function() {load_image(label, img)} );
     28 
     29  initiator_url_test(resource, expectedInitiatorUrl, resource +
     30    " initiatorUrl from fullfilled promise", resource + " timeout");
     31 
     32 </script>