forked from mirrors/gecko-dev
Automatic update from web-platform-tests Reattempt upstreaming of JS Self-Profiling API WPTs Wait for a delay of SAMPLE_INTERVAL + 500ms to collect samples, ensuring that we're more robust to flakiness on Mac OS CI bots. Bug: 956688 Change-Id: If39f1d59a09857d5bcb52c5c5d03782de4055b30 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3021557 Reviewed-by: Nicolás Peña Moreno <npm@chromium.org> Commit-Queue: Andrew Comminos <acomminos@fb.com> Cr-Commit-Position: refs/heads/master@{#901174} -- wpt-commits: 9d6d7f8c5356ab9fc4b49656323ce196f1176613 wpt-pr: 29645
19 lines
533 B
JavaScript
19 lines
533 B
JavaScript
// META: script=resources/profile-utils.js
|
|
|
|
promise_test(async () => {
|
|
const start = performance.now();
|
|
|
|
const profiler = new Profiler({
|
|
sampleInterval: 10,
|
|
maxBufferSize: Number.MAX_SAFE_INTEGER,
|
|
});
|
|
ProfileUtils.forceSample();
|
|
const trace = await profiler.stop();
|
|
|
|
const end = performance.now();
|
|
|
|
assert_greater_than(trace.samples.length, 0);
|
|
for (const sample of trace.samples) {
|
|
assert_between_inclusive(sample.timestamp, start, end);
|
|
}
|
|
}, 'sample timestamps use the current high-resolution time');
|