зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1503355 [wpt PR 13789] - Make Server-Timing tests more resilient, a=testonly
Automatic update from web-platform-testsMake Server-Timing tests more resilient (#13789) -- wpt-commits: 5c95adc476aa7273b152d2468b5e71b42757f007 wpt-pr: 13789
This commit is contained in:
Родитель
0b61e937ad
Коммит
305fad09c9
|
@ -42,3 +42,10 @@ function test_entries(actualEntries, expectedEntries) {
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
function delayedLoadListener(callback) {
|
||||
window.addEventListener('load', function() {
|
||||
// TODO(cvazac) Remove this setTimeout when spec enforces sync entries.
|
||||
step_timeout(callback, 0)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<head>
|
||||
<meta charset='utf-8' />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src='/resources/testharnessreport.js'></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/performance-timeline-utils.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script>
|
||||
|
@ -20,7 +20,7 @@
|
|||
document.getElementsByTagName('script')[0].parentNode.appendChild(img)
|
||||
})
|
||||
|
||||
window.addEventListener('load', function() {
|
||||
delayedLoadListener(function() {
|
||||
function assertServerTimingEntries(url, expectedEntryCount) {
|
||||
test_equals(performance.getEntriesByName(url)[0].serverTiming.length,
|
||||
expectedEntryCount,
|
||||
|
|
|
@ -2,10 +2,11 @@
|
|||
<head>
|
||||
<meta charset='utf-8' />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src='/resources/testharnessreport.js'></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/performance-timeline-utils.js"></script>
|
||||
<script>
|
||||
setup({explicit_done: true})
|
||||
window.addEventListener('load', function(){
|
||||
delayedLoadListener(function(){
|
||||
assert_not_equals(typeof performance.getEntriesByType('navigation')[0].serverTiming, 'undefined',
|
||||
'An instance of `PerformanceNavigationTiming` should have a `serverTiming` attribute.')
|
||||
done()
|
||||
|
|
|
@ -2,10 +2,11 @@
|
|||
<head>
|
||||
<meta charset='utf-8' />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src='/resources/testharnessreport.js'></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/performance-timeline-utils.js"></script>
|
||||
<script>
|
||||
setup({explicit_done: true})
|
||||
window.addEventListener('load', function(){
|
||||
delayedLoadListener(function(){
|
||||
assert_not_equals(typeof performance.getEntriesByType('resource')[0].serverTiming, 'undefined',
|
||||
'An instance of `PerformanceResourceTiming` should have a `serverTiming` attribute.')
|
||||
done()
|
||||
|
|
|
@ -7,7 +7,7 @@ tests generated by:
|
|||
<head>
|
||||
<meta charset='utf-8' />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src='/resources/testharnessreport.js'></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/performance-timeline-utils.js"></script>
|
||||
<script>
|
||||
setup({explicit_done: true})
|
||||
|
@ -49,6 +49,6 @@ tests generated by:
|
|||
document.getElementsByTagName('head')[0].appendChild(script)
|
||||
urlToIndex[script.src] = i
|
||||
}
|
||||
window.addEventListener('load', runTests)
|
||||
delayedLoadListener(runTests)
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<head>
|
||||
<meta charset='utf-8' />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src='/resources/testharnessreport.js'></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
(async () => {
|
||||
const scope = 'does/not/exist'
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
<head>
|
||||
<meta charset='utf-8' />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src='/resources/testharnessreport.js'></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/performance-timeline-utils.js"></script>
|
||||
<script>
|
||||
setup({explicit_done: true})
|
||||
|
||||
window.addEventListener('load', function() {
|
||||
delayedLoadListener(function() {
|
||||
// there should be exactly three server-timing entries, 2 for document, 1 for img#one
|
||||
test_entries(performance.getEntriesByType('navigation')[0].serverTiming, [{
|
||||
duration: 1.1,
|
||||
|
|
Загрузка…
Ссылка в новой задаче