node/test/wpt/test-performance-timeline.js
Khafra e2697c1a64
perf_hooks: add deliveryType and responseStatus fields
PR-URL: https://github.com/nodejs/node/pull/51589
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-05-12 20:02:48 +02:00

34 lines
909 B
JavaScript

'use strict';
const { WPTRunner } = require('../common/wpt');
const runner = new WPTRunner('performance-timeline');
runner.pretendGlobalThisAs('Window');
runner.setInitScript(`
// Create a dummy resource timing entry to mimic how the browser would
// record the initial page load.
performance.markResourceTiming({
startTime: 0,
endTime: 0,
finalServiceWorkerStartTime: 0,
redirectStartTime: 0,
redirectEndTime: 0,
postRedirectStartTime: 0,
finalConnectionTimingInfo: {
domainLookupStartTime: 0,
domainLookupEndTime: 0,
connectionStartTime: 0,
connectionEndTime: 0,
secureConnectionStartTime: 0,
ALPNNegotiatedProtocol: '',
},
finalNetworkRequestStartTime: 0,
finalNetworkResponseStartTime: 0,
encodedBodySize: 0,
decodedBodySize: 0,
}, 'https://nodejs.org', '', global, '', {}, 200, '');
`);
runner.runJsTests();