blob: 7cc2be9de5baf405689d03374154c50ff693a653 [file] [log] [blame]
Andrew Top61a84952019-04-30 15:07:33 -07001<!DOCTYPE html>
2<meta charset="utf-8">
3<title>Notification.onshow (basic)</title>
4<link rel="author" title="Intel" href="http://www.intel.com/">
5<link rel="author" title="Xin Liu" href="mailto:xinx.liu@intel.com">
6<script src="/resources/testharness.js"></script>
7<script src="/resources/testharnessreport.js"></script>
8<script>
9test(function() {
10 if (Notification.permission != "granted") {
11 this.force_timeout()
12 this.set_status(this.NOTRUN, "You must allow notifications for this"
13 + " origin before running this test.")
14 } else {
15 var t = async_test("Invoked the onshow event handler.")
16 var notification = new Notification("New Email Received")
17 notification.onshow = t.step_func(function(e) {
18 assert_equals(Object.prototype.toString.call(e), "[object Event]")
19 assert_equals(e.type, "show", "Checked the event type.")
20 notification.close()
21 t.done()
22 })
23 }
24}, "Checked test prerequisites.")
25</script>