%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
// This file may needs to be updated to wpt: // https://github.com/web-platform-tests/wpt import '../common/index.mjs'; import assert from 'assert'; import { performance } from 'perf_hooks'; import { setTimeout } from 'timers/promises'; // Order by startTime performance.mark('one'); await setTimeout(50); performance.mark('two'); await setTimeout(50); performance.mark('three'); await setTimeout(50); performance.measure('three', 'three'); await setTimeout(50); performance.measure('two', 'two'); await setTimeout(50); performance.measure('one', 'one'); const entries = performance.getEntriesByType('measure'); assert.deepStrictEqual(entries.map((x) => x.name), ['one', 'two', 'three']); const allEntries = performance.getEntries(); assert.deepStrictEqual(allEntries.map((x) => x.name), ['one', 'one', 'two', 'two', 'three', 'three']); performance.mark('a'); await setTimeout(50); performance.measure('a', 'a'); await setTimeout(50); performance.mark('a'); await setTimeout(50); performance.measure('a', 'one'); const entriesByName = performance.getEntriesByName('a'); assert.deepStrictEqual(entriesByName.map((x) => x.entryType), ['measure', 'mark', 'measure', 'mark']); // getEntriesBy[Name|Type](undefined) performance.mark(undefined); assert.strictEqual(performance.getEntriesByName(undefined).length, 1); assert.strictEqual(performance.getEntriesByType(undefined).length, 0); assert.throws(() => performance.getEntriesByName(), { name: 'TypeError', message: 'The "name" argument must be specified', code: 'ERR_MISSING_ARGS' }); assert.throws(() => performance.getEntriesByType(), { name: 'TypeError', message: 'The "type" argument must be specified', code: 'ERR_MISSING_ARGS' });