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
36 lines
1.1 KiB
HTML
36 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
|
|
<script src="resources/profile-utils.js"></script>
|
|
</head>
|
|
<body>
|
|
<iframe src="resources/child-frame.html"></iframe>
|
|
|
|
<script>
|
|
promise_test(_ => new Promise(res => window.addEventListener('load', res)),
|
|
'wait for load event');
|
|
|
|
promise_test(async t => {
|
|
const profiler = new Profiler({
|
|
sampleInterval: 10,
|
|
maxBufferSize: Number.MAX_SAFE_INTEGER,
|
|
});
|
|
|
|
const iframe = frames[0];
|
|
await ProfileUtils.forceSampleFrame(iframe);
|
|
|
|
const trace = await profiler.stop();
|
|
|
|
assert_false(ProfileUtils.containsFrame(trace, { name: 'sampleFromMessage' }),
|
|
'function from child context not included in trace');
|
|
|
|
const childUrl = iframe.src;
|
|
assert_false(ProfileUtils.containsResource(trace, childUrl),
|
|
'child resources are not included');
|
|
}, 'functions from child frame are not included in profile created by parent frame');
|
|
</script>
|
|
</body>
|
|
</html>
|