summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/js-self-profiling/tentative
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/js-self-profiling/tentative
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/js-self-profiling/tentative')
-rw-r--r--testing/web-platform/tests/js-self-profiling/tentative/README.md3
-rw-r--r--testing/web-platform/tests/js-self-profiling/tentative/marker-vm-state.https.html37
-rw-r--r--testing/web-platform/tests/js-self-profiling/tentative/marker-vm-state.https.html.headers3
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