mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-10 13:18:45 +02:00
Automatic update from web-platform-testsMerge pull request #11013 from cvazac/master Server-Timing: clean up service-worker test -- wpt-commits: 5478850d0df6d1d0f2e8c10f77f62d3c6e2dd589 wpt-pr: 11013
19 lines
585 B
JavaScript
19 lines
585 B
JavaScript
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)
|
|
})
|
|
})
|
|
})
|