Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!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>