tor-browser

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

sw.js (585B)


      1 importScripts('/resources/testharness.js')
      2 
      3 promise_test((test) => {
      4  return fetch('./sw.js').then((response) => {
      5    return new Promise((resolve, reject) => {
      6      step_timeout(() => {
      7        const entry = performance.getEntriesByName(response.url)[0]
      8        if (!entry) {
      9          reject('no entry: ' + response.url)
     10        }
     11 
     12        assert_not_equals(typeof entry.serverTiming,
     13          'undefined',
     14          'An instance of `PerformanceResourceTiming` should have a `serverTiming` attribute in the Service Worker context.')
     15        resolve()
     16      }, 250)
     17    })
     18  })
     19 })