tor-browser

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

cross_origin.https.html (1423B)


      1 <!DOCTYPE html>
      2 <head>
      3    <meta charset='utf-8' />
      4    <script src="/resources/testharness.js"></script>
      5    <script src="/resources/testharnessreport.js"></script>
      6    <script src="/common/performance-timeline-utils.js"></script>
      7    <script src="/common/get-host-info.sub.js"></script>
      8    <script>
      9      setup({explicit_done: true})
     10 
     11      const hostInfo = get_host_info()
     12      const urls = {
     13        'same-origin': `${hostInfo.HTTPS_ORIGIN}/server-timing/resources/blue.png`,
     14        'cross-origin': `${hostInfo.HTTPS_REMOTE_ORIGIN}/server-timing/resources/blue.png`,
     15        'cross-origin-tao': `${hostInfo.HTTPS_REMOTE_ORIGIN}/server-timing/resources/blue_tao.png`
     16      }
     17      Object.keys(urls).forEach(function(key) {
     18        const img = document.createElement('img')
     19        img.src = urls[key]
     20        document.getElementsByTagName('script')[0].parentNode.appendChild(img)
     21      })
     22 
     23      delayedLoadListener(function() {
     24        function assertServerTimingEntries(url, expectedEntryCount) {
     25          test_equals(performance.getEntriesByName(url)[0].serverTiming.length,
     26            expectedEntryCount,
     27            `Expected entry count for ${url}: ${expectedEntryCount}`)
     28        }
     29        assertServerTimingEntries(urls['same-origin'], 1)
     30        assertServerTimingEntries(urls['cross-origin'], 0)
     31        assertServerTimingEntries(urls['cross-origin-tao'], 1)
     32        done()
     33      })
     34    </script>
     35 </head>