summaryrefslogtreecommitdiffstats
path: root/dom/performance/tests/test_performance_paint_observer_helper.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /dom/performance/tests/test_performance_paint_observer_helper.html
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/performance/tests/test_performance_paint_observer_helper.html')
-rw-r--r--dom/performance/tests/test_performance_paint_observer_helper.html35
1 files changed, 35 insertions, 0 deletions
diff --git a/dom/performance/tests/test_performance_paint_observer_helper.html b/dom/performance/tests/test_performance_paint_observer_helper.html
new file mode 100644
index 0000000000..ae27c9480d
--- /dev/null
+++ b/dom/performance/tests/test_performance_paint_observer_helper.html
@@ -0,0 +1,35 @@
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<!DOCTYPE html>
+<html>
+ <body>
+ </body>
+ <script>
+ var promise = new Promise(resolve => {
+ var observer = new PerformanceObserver(list => resolve(list));
+ observer.observe({entryTypes: ["paint"]});
+ });
+
+ promise.then(list => {
+ var perfEntries = list.getEntries();
+ opener.is(list.getEntries().length, 1);
+ opener.isDeeply(list.getEntries(),
+ performance.getEntriesByType("paint"),
+ "Observed 'paint' entries should equal to entries obtained by getEntriesByType.");
+ opener.isDeeply(list.getEntries({name: "paint"}),
+ performance.getEntriesByName("paint"),
+ "getEntries with name filter should return correct results.");
+ opener.isDeeply(list.getEntries({entryType: "paint"}),
+ performance.getEntriesByType("paint"),
+ "getEntries with entryType filter should return correct results.");
+ opener.done();
+ });
+
+ const img = document.createElement("IMG");
+ img.src = "http://example.org/tests/dom/performance/tests/logo.png";
+ document.body.appendChild(img);
+
+ </script>
+</html>