diff --git a/lib/fetch/index.js b/lib/fetch/index.js index 6e356de8128..e3834a7f1c6 100644 --- a/lib/fetch/index.js +++ b/lib/fetch/index.js @@ -297,7 +297,7 @@ function finalizeAndReportTiming (response, initiatorType = 'other') { // capability. // TODO: given global’s relevant settings object’s cross-origin isolated // capability? - response.timingInfo.endTime = coarsenedSharedCurrentTime() + timingInfo.endTime = coarsenedSharedCurrentTime() // 10. Set response’s timing info to timingInfo. response.timingInfo = timingInfo diff --git a/test/fetch/resource-timing.js b/test/fetch/resource-timing.js index c8732198c30..885e3b3c171 100644 --- a/test/fetch/resource-timing.js +++ b/test/fetch/resource-timing.js @@ -13,7 +13,7 @@ const { const skip = nodeMajor < 18 || (nodeMajor === 18 && nodeMinor < 2) test('should create a PerformanceResourceTiming after each fetch request', { skip }, (t) => { - t.plan(4) + t.plan(6) const obs = new PerformanceObserver(list => { const entries = list.getEntries() t.equal(entries.length, 1) @@ -25,6 +25,9 @@ test('should create a PerformanceResourceTiming after each fetch request', { ski }) t.strictSame(entry.entryType, 'resource') + t.ok(entry.duration >= 0) + t.ok(entry.startTime >= 0) + obs.disconnect() performance.clearResourceTimings() })