tor-browser

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

nested-nav-fallback-timing.html (1273B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>Test ResourceTiming reporting for cross-origin iframe.</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/common/get-host-info.sub.js"></script>
      7 <script src="resources/observe-entry.js"></script>
      8 </head>
      9 <body>
     10 <body>
     11 <script>
     12  const {REMOTE_ORIGIN} = get_host_info();
     13 
     14  promise_test(async t => {
     15    const iframe = document.createElement('iframe');
     16    t.add_cleanup(() => iframe.remove());
     17    iframe.src = `${REMOTE_ORIGIN}/resource-timing/resources/delay-load.html`;
     18    document.body.appendChild(iframe);
     19    const entry = await observe_entry(iframe.src);
     20    assert_greater_than(entry.duration, 1000);
     21  }, "Cross-origin TAO-fail IFrame entries should report window load time");
     22 
     23  promise_test(async t => {
     24    const object = document.createElement('object');
     25    object.type = "text/html";
     26    t.add_cleanup(() => object.remove());
     27    object.data = `${REMOTE_ORIGIN}/resource-timing/resources/delay-load.html`;
     28    document.body.appendChild(object);
     29    const entry = await observe_entry(object.data);
     30    assert_greater_than(entry.duration, 1000);
     31  }, "Cross-origin TAO-fail object entries should report window load time");
     32 
     33  </script>