https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 7d92dbd58ac296da6fb2e24d9c9758775e873088 authored by Mike West on 06 December 2018, 10:19:53 UTC
Trusted Types: URLs should be USVString, not DOMString.
Tip revision: 7d92dbd
sw.js
importScripts('/resources/testharness.js')

promise_test((test) => {
  return fetch('./sw.js').then((response) => {
    return new Promise((resolve, reject) => {
      step_timeout(() => {
        const entry = performance.getEntriesByName(response.url)[0]
        if (!entry) {
          reject('no entry: ' + response.url)
        }

        assert_not_equals(typeof entry.serverTiming,
          'undefined',
          'An instance of `PerformanceResourceTiming` should have a `serverTiming` attribute in the Service Worker context.')
        resolve()
      }, 250)
    })
  })
})
back to top