OLD | NEW |
1 <?php | 1 <?php |
2 header("Content-Security-Policy: suborigin foobar"); | 2 header("Content-Security-Policy: suborigin foobar"); |
3 ?> | 3 ?> |
4 <!DOCTYPE html> | 4 <!DOCTYPE html> |
5 <html> | 5 <html> |
6 <head> | 6 <head> |
7 <title>Notifications are denied in suborigins.</title> | 7 <title>Notifications are denied in suborigins.</title> |
8 <script src="/resources/testharness.js"></script> | 8 <script src="/resources/testharness.js"></script> |
9 <script src="/resources/testharnessreport.js"></script> | 9 <script src="/resources/testharnessreport.js"></script> |
10 </head> | 10 </head> |
11 <script> | 11 <script> |
| 12 testRunner.setPermission('notifications', 'granted', location.origin, location
.origin); |
12 testRunner.grantWebNotificationPermission(location.origin, true); | 13 testRunner.grantWebNotificationPermission(location.origin, true); |
13 Notification.requestPermission(function (status) { | 14 Notification.requestPermission(function (status) { |
14 assert_equals(status, 'default', 'The notification permission request shou
ld not be granted.'); | 15 assert_equals(status, 'default', 'The notification permission request shou
ld not be granted.'); |
15 | 16 |
16 var notification = new Notification('My Notification'); | 17 var notification = new Notification('My Notification'); |
17 notification.addEventListener('show', function() { | 18 notification.addEventListener('show', function() { |
18 assert_unreached('The notification is not expected to be shown.'); | 19 assert_unreached('The notification is not expected to be shown.'); |
19 }); | 20 }); |
20 | 21 |
21 notification.addEventListener('error', function() { | 22 notification.addEventListener('error', function() { |
22 done(); | 23 done(); |
23 }); | 24 }); |
24 }); | 25 }); |
25 </script> | 26 </script> |
26 </html> | 27 </html> |
OLD | NEW |