diff options
Diffstat (limited to 'testing/web-platform/tests/js-self-profiling/tentative')
3 files changed, 43 insertions, 0 deletions
diff --git a/testing/web-platform/tests/js-self-profiling/tentative/README.md b/testing/web-platform/tests/js-self-profiling/tentative/README.md new file mode 100644 index 0000000000..a6b8d008f2 --- /dev/null +++ b/testing/web-platform/tests/js-self-profiling/tentative/README.md @@ -0,0 +1,3 @@ +Tests in this directory are for the proposed js-self-profiling API marker extension. This is not yet standardised and browsers should not be expected to pass these tests. + +See the explainer at https://github.com/WICG/js-self-profiling/blob/main/markers.md for more information about the API. diff --git a/testing/web-platform/tests/js-self-profiling/tentative/marker-vm-state.https.html b/testing/web-platform/tests/js-self-profiling/tentative/marker-vm-state.https.html new file mode 100644 index 0000000000..07dbe7f0ff --- /dev/null +++ b/testing/web-platform/tests/js-self-profiling/tentative/marker-vm-state.https.html @@ -0,0 +1,37 @@ +<!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> diff --git a/testing/web-platform/tests/js-self-profiling/tentative/marker-vm-state.https.html.headers b/testing/web-platform/tests/js-self-profiling/tentative/marker-vm-state.https.html.headers new file mode 100644 index 0000000000..228047a15a --- /dev/null +++ b/testing/web-platform/tests/js-self-profiling/tentative/marker-vm-state.https.html.headers @@ -0,0 +1,3 @@ +Document-Policy: js-profiling +Cross-Origin-Embedder-Policy: require-corp +Cross-Origin-Opener-Policy: same-origin |