forked from mirrors/gecko-dev
Automatic update from web-platform-tests Add ProfilerMarker idl Add ProfilerMarker, a CrossOriginIsolated extension for JS-Self-Profiling API. explainer: https://github.com/WICG/js-self-profiling/blob/main/markers.md Bug: 1263871 Change-Id: I6c8cfea0acf03839d7dfb95377b89049b00bdd61 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3307663 Reviewed-by: Nicolás Peña <npm@chromium.org> Auto-Submit: Corentin Pescheloche <cpescheloche@fb.com> Reviewed-by: Camillo Bruni <cbruni@chromium.org> Reviewed-by: Yoav Weiss <yoavweiss@chromium.org> Commit-Queue: Yoav Weiss <yoavweiss@chromium.org> Cr-Commit-Position: refs/heads/main@{#960059} -- wpt-commits: 862c8c3faca60a176d0f12f1a0ca65b803cdee81 wpt-pr: 32282
37 lines
872 B
HTML
37 lines
872 B
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>
|
|
|
|
<script>
|
|
// Note: moving these function definitions will change the expected
|
|
// outcomes below.
|
|
function scriptFunction(sample) {
|
|
sample();
|
|
}
|
|
</script>
|
|
|
|
<script>
|
|
promise_test(async t => {
|
|
// *.headers file should ensure we sesrve COOP and COEP headers.
|
|
assert_true(self.crossOriginIsolated,
|
|
"Cross origin isolation is required to surface markers");
|
|
const trace = await ProfileUtils.profileFunction(scriptFunction);
|
|
|
|
assert_true(ProfileUtils.containsSample(trace, {
|
|
stackId: 7,
|
|
marker: 'script'
|
|
}));
|
|
}, 'markers logged correctly');
|
|
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|