<!doctype html>
<html>
<head>
<title>Verifies that double-closing a notification doesn't crash.</title>
<meta charset="utf-8">
</head>
<body>
<script>
function createNotification(iconUrl, title, text, tag) {
var notification = new Notification(title, {
icon: iconUrl,
body: text,
tag: tag
});
return new Promise(resolve => {
notification.onshow = function() {
resolve("0"); // success
};
notification.onerror = function() {
resolve("-1"); // failure
};
notification.onclose = function() {
notification.close();
};
});
}
</script>
</body>
</html>