https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 259d0612af038d14f2cd889a14a3adb6c9e96d96 authored by Josh Matthews on 23 December 2018, 05:25:51 UTC
Claim to support testdriver in servodriver
Tip revision: 259d061
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