4 <title>Notifications: Creating notifications should fail when no permission has been granted.
</title>
5 <script src=
"../resources/testharness.js"></script>
6 <script src=
"../resources/testharnessreport.js"></script>
10 // Tests that Notification.requestPermission() returns "denied" when no
11 // permission has been granted, causing creation of notifications to fail
12 // because of that. When running this test manually, deny permission
13 // for displaying notifications prior to running the test.
14 async_test(function (test
) {
15 Notification
.requestPermission(function (status
) {
16 assert_equals(status
, 'denied');
18 var notification
= new Notification('My Notification');
19 notification
.addEventListener('show', function() {
20 assert_unreached('The notification is not expected to be shown.');
23 notification
.addEventListener('error', function() {
28 }, 'Notification creation fails when no permission has been granted.');