From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../supported-navigation-type.window.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 testing/web-platform/tests/navigation-timing/supported-navigation-type.window.js (limited to 'testing/web-platform/tests/navigation-timing/supported-navigation-type.window.js') diff --git a/testing/web-platform/tests/navigation-timing/supported-navigation-type.window.js b/testing/web-platform/tests/navigation-timing/supported-navigation-type.window.js new file mode 100644 index 0000000000..3239c7d29f --- /dev/null +++ b/testing/web-platform/tests/navigation-timing/supported-navigation-type.window.js @@ -0,0 +1,20 @@ +test(() => { + if (typeof PerformanceObserver.supportedEntryTypes === "undefined") + assert_unreached("supportedEntryTypes is not supported."); + assert_true(PerformanceObserver.supportedEntryTypes.includes("navigation"), + "There should be an entry 'navigation' in PerformanceObserver.supportedEntryTypes"); +}, "supportedEntryTypes contains 'navigation'."); + +if (typeof PerformanceObserver.supportedEntryTypes !== "undefined") { + const entryType = "navigation"; + if (PerformanceObserver.supportedEntryTypes.includes(entryType)) { + promise_test(async() => { + await new Promise((resolve) => { + new PerformanceObserver(function (list, observer) { + observer.disconnect(); + resolve(); + }).observe({entryTypes: [entryType]}); + }) + }, `'${entryType}' entries should be observable.`) + } +} -- cgit v1.2.3