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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
|
<!doctype html>
<title> PageTransitionEffect Event </title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
var e = new PageTransitionEvent("pageshow", {persisted:false, cancelable:false, bubbles:false});
assert_true(e instanceof PageTransitionEvent);
assert_equals(e.type, "pageshow");
assert_false(e.bubbles, "bubbles");
assert_false(e.cancelable, "cancelable");
assert_false(e.persisted, "persisted");
}, "Constructing pageshow event");
test(function() {
var e = new PageTransitionEvent("pagehide", {persisted:false, cancelable:false, bubbles:false});
assert_true(e instanceof PageTransitionEvent);
assert_equals(e.type, "pagehide");
assert_false(e.persisted, "persisted");
assert_false(e.bubbles, "bubbles");
assert_false(e.cancelable, "cancelable");
}, "Constructing pagehide event");
test(function() {
var e = new PageTransitionEvent("pageshow", {persisted:true});
assert_true(e instanceof PageTransitionEvent);
assert_equals(e.type, "pageshow");
assert_true(e.persisted, "persisted");
assert_false(e.bubbles, "bubbles");
assert_false(e.cancelable, "cancelable");
}, "Constructing pageshow event, persisted true");
test(function() {
var e = new PageTransitionEvent("pagehide", {persisted:true});
assert_true(e instanceof PageTransitionEvent);
assert_equals(e.type, "pagehide");
assert_true(e.persisted, "persisted");
assert_false(e.bubbles, "bubbles");
assert_false(e.cancelable, "cancelable");
}, "Constructing pagehide event, persisted true");
test(function() {
var e = new PageTransitionEvent("pageshow", {});
assert_true(e instanceof PageTransitionEvent);
assert_equals(e.type, "pageshow");
assert_false(e.persisted, "persisted");
assert_false(e.bubbles, "bubbles");
assert_false(e.cancelable, "cancelable");
}, "Constructing pageshow event, empty options");
test(function() {
var e = new PageTransitionEvent("pagehide", {});
assert_true(e instanceof PageTransitionEvent);
assert_equals(e.type, "pagehide");
assert_false(e.persisted, "persisted");
assert_false(e.bubbles, "bubbles");
assert_false(e.cancelable, "cancelable");
}, "Constructing pagehide event, empty options");
test(function() {
var e = new PageTransitionEvent("pageshow");
assert_true(e instanceof PageTransitionEvent);
assert_equals(e.type, "pageshow");
assert_false(e.persisted, "persisted");
assert_false(e.bubbles, "bubbles");
assert_false(e.cancelable, "cancelable");
}, "Constructing pageshow event, missing options");
test(function() {
var e = new PageTransitionEvent("pagehide");
assert_true(e instanceof PageTransitionEvent);
assert_equals(e.type, "pagehide");
assert_false(e.persisted, "persisted");
assert_false(e.bubbles, "bubbles");
assert_false(e.cancelable, "cancelable");
}, "Constructing pagehide event, missing options");
test(function() {
var e = new PageTransitionEvent("pageshow", {persisted:null});
assert_true(e instanceof PageTransitionEvent);
assert_equals(e.type, "pageshow");
assert_false(e.persisted, "persisted");
assert_false(e.bubbles, "bubbles");
assert_false(e.cancelable, "cancelable");
}, "Constructing pageshow event, persisted:null");
test(function() {
var e = new PageTransitionEvent("pagehide", {persisted:null});
assert_true(e instanceof PageTransitionEvent);
assert_equals(e.type, "pagehide");
assert_false(e.persisted, "persisted");
assert_false(e.bubbles, "bubbles");
assert_false(e.cancelable, "cancelable");
}, "Constructing pagehide event, persisted:null");
test(function() {
var e = new PageTransitionEvent("pageshow", {persisted:undefined});
assert_true(e instanceof PageTransitionEvent);
assert_equals(e.type, "pageshow");
assert_false(e.persisted, "persisted");
assert_false(e.bubbles, "bubbles");
assert_false(e.cancelable, "cancelable");
}, "Constructing pageshow event, persisted:undefined");
test(function() {
var e = new PageTransitionEvent("pagehide", {persisted:undefined});
assert_true(e instanceof PageTransitionEvent);
assert_equals(e.type, "pagehide");
assert_false(e.persisted, "persisted");
assert_false(e.bubbles, "bubbles");
assert_false(e.cancelable, "cancelable");
}, "Constructing pagehide event, persisted:undefined");
test(function() {
var e = new PageTransitionEvent("pageshow", {bubbles:true});
assert_true(e instanceof PageTransitionEvent);
assert_equals(e.type, "pageshow");
assert_false(e.persisted, "persisted");
assert_true(e.bubbles, "bubbles");
assert_false(e.cancelable, "cancelable");
}, "Constructing pageshow event, bubbles:true");
test(function() {
var e = new PageTransitionEvent("pagehide", {bubbles:true});
assert_true(e instanceof PageTransitionEvent);
assert_equals(e.type, "pagehide");
assert_false(e.persisted, "persisted");
assert_true(e.bubbles, "bubbles");
assert_false(e.cancelable, "cancelable");
}, "Constructing pagehide event, bubbles:true");
test(function() {
var e = new PageTransitionEvent("pageshow", {cancelable:true});
assert_true(e instanceof PageTransitionEvent);
assert_equals(e.type, "pageshow");
assert_false(e.persisted, "persisted");
assert_false(e.bubbles, "bubbles");
assert_true(e.cancelable, "cancelable");
}, "Constructing pageshow event, cancelable:true");
test(function() {
var e = new PageTransitionEvent("pagehide", {cancelable:true});
assert_true(e instanceof PageTransitionEvent);
assert_equals(e.type, "pagehide");
assert_false(e.persisted, "persisted");
assert_false(e.bubbles, "bubbles");
assert_true(e.cancelable, "cancelable");
}, "Constructing pagehide event, cancelable:true");
</script>
|