1
0
Fork 0
firefox/testing/web-platform/tests/navigation-api/currententrychange-event/constructor.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

32 lines
1 KiB
HTML

<!doctype html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(() => {
assert_throws_js(TypeError, () => {
new NavigationCurrentEntryChangeEvent("currententrychange");
});
}, "can't bypass required members by omitting the dictionary entirely");
test(() => {
assert_throws_js(TypeError, () => {
new NavigationCurrentEntryChangeEvent("currententrychange", {
navigationType: "push"
});
});
}, "from is required");
test(() => {
const event = new NavigationCurrentEntryChangeEvent("currententrychange", {
navigationType: "replace",
from: navigation.currentEntry
});
assert_equals(event.navigationType, "replace");
assert_equals(event.from, navigation.currentEntry);
}, "all properties are reflected back");
test(t => {
const event = new NavigationCurrentEntryChangeEvent("currententrychange", { from: navigation.currentEntry });
assert_equals(event.navigationType, null);
}, "defaults are as expected");
</script>