Revision cf39c87ae4712892c3da1238e672dba932996ae5 authored by Maja Frydrychowicz on 11 April 2018, 09:34:00 UTC, committed by moz-wptsync-bot on 11 April 2018, 13:24:57 UTC
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1432105
gecko-commit: f6b8d9c6cbfa3b4a1b0437cee337ff636b3cfcbe
gecko-integration-branch: central
gecko-reviewers: whimboo
1 parent 7967c43
Raw File
event-onclose.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Notification.onclose (basic)</title>
<link rel="author" title="Apple Inc." href="http://www.apple.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 onclose event handler.")
        var notification = new Notification("New Email Received")
        notification.onshow = t.step_func(function() {
            notification.close()
        })
        notification.onclose = t.step_func(function(e) {
            assert_equals(Object.prototype.toString.call(e), "[object Event]")
            assert_equals(e.type, "close", "Checked the event type.")
            t.done()
        })
    }
}, "Checked test prerequisites.")
</script>
back to top