Revision e01a49c08af9328337c80b5d946d24b5274bc400 authored by Brad Werth on 26 April 2018, 08:13:36 UTC, committed by moz-wptsync-bot on 26 April 2018, 08:42:17 UTC
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1265342 gecko-commit: 3032f8adbcf177c75cb7ddacaade47e23e1ed88f gecko-integration-branch: central gecko-reviewers: dholbert
1 parent c09df8b
event-onshow.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Notification.onshow (basic)</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<link rel="author" title="Xin Liu" href="mailto:xinx.liu@intel.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(function() {
if (Notification.permission != "granted") {
this.force_timeout()
this.set_status(this.NOTRUN, "You must allow notifications for this"
+ " origin before running this test.")
} else {
var t = async_test("Invoked the onshow event handler.")
var notification = new Notification("New Email Received")
notification.onshow = t.step_func(function(e) {
assert_equals(Object.prototype.toString.call(e), "[object Event]")
assert_equals(e.type, "show", "Checked the event type.")
notification.close()
t.done()
})
}
}, "Checked test prerequisites.")
</script>
Computing file changes ...