mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 15:58:39 +09:00
moebius#158: The Performance Resource Timing (added support for "workerStart")
https://github.com/MoonchildProductions/moebius/pull/158
This commit is contained in:
parent
6a97ee9379
commit
6885700c5b
26 changed files with 746 additions and 70 deletions
|
|
@ -13,6 +13,10 @@ function verify(performance, resource, description) {
|
|||
assert_greater_than(entry.workerStart, 0, description);
|
||||
assert_greater_than_equal(entry.workerStart, entry.startTime, description);
|
||||
assert_less_than_equal(entry.workerStart, entry.fetchStart, description);
|
||||
assert_greater_than_equal(entry.responseStart, entry.fetchStart, description);
|
||||
assert_greater_than_equal(entry.responseEnd, entry.responseStart, description);
|
||||
assert_greater_than(entry.responseEnd, entry.fetchStart, description);
|
||||
assert_greater_than(entry.duration, 0, description);
|
||||
if (resource.indexOf('redirect.py') != -1) {
|
||||
assert_less_than_equal(entry.workerStart, entry.redirectStart,
|
||||
description);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
self.addEventListener('fetch', function(event) {
|
||||
if (event.request.url.indexOf('dummy.js') != -1) {
|
||||
event.respondWith(new Response());
|
||||
event.respondWith(new Promise(resolve => {
|
||||
// Slightly delay the response so we ensure we get a non-zero
|
||||
// duration.
|
||||
setTimeout(_ => resolve(new Response()), 100);
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue