-
Notifications
You must be signed in to change notification settings - Fork 3.2k
/
constructor.html
32 lines (29 loc) · 1.01 KB
/
constructor.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!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>