2021-06-24 15:33:09 +00:00
|
|
|
'use strict';
|
2023-02-25 16:04:40 +00:00
|
|
|
|
2021-06-24 15:33:09 +00:00
|
|
|
const { WPTRunner } = require('../common/wpt');
|
|
|
|
|
2021-07-26 15:16:00 +00:00
|
|
|
const runner = new WPTRunner('performance-timeline');
|
2021-06-24 15:33:09 +00:00
|
|
|
|
2022-08-17 16:46:14 +00:00
|
|
|
runner.pretendGlobalThisAs('Window');
|
2021-06-24 15:33:09 +00:00
|
|
|
runner.setInitScript(`
|
2022-08-17 16:46:14 +00:00
|
|
|
// 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,
|
2024-05-12 18:02:48 +00:00
|
|
|
}, 'https://nodejs.org', '', global, '', {}, 200, '');
|
2021-06-24 15:33:09 +00:00
|
|
|
`);
|
|
|
|
|
|
|
|
runner.runJsTests();
|