| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <p> | 7 <p> |
| 8 Tests that the return values of Notification.permission match | 8 Tests that the return values of Notification.permission match |
| 9 the permission request status. | 9 the permission request status. |
| 10 </p> | 10 </p> |
| 11 <div id="console"></div> | 11 <div id="console"></div> |
| 12 <script> | 12 <script> |
| 13 if (!window.testRunner) { | 13 if (!window.testRunner) { |
| 14 testFailed("This test depends on window.testRunner to toggle per
missions."); | 14 testFailed("This test depends on window.testRunner to toggle per
missions."); |
| 15 } else { | 15 } else { |
| 16 testRunner.clearWebNotificationPermissions(); |
| 17 |
| 16 // The "default" state indicates that no permission request has | 18 // The "default" state indicates that no permission request has |
| 17 // been answered yet. | 19 // been answered yet. |
| 18 shouldBeEqualToString("Notification.permission", "default"); | 20 shouldBeEqualToString("Notification.permission", "default"); |
| 19 | 21 |
| 20 window.testRunner.grantWebNotificationPermission("file://", fals
e); | 22 testRunner.grantWebNotificationPermission("file://", false); |
| 21 shouldBeEqualToString("Notification.permission", "denied"); | 23 shouldBeEqualToString("Notification.permission", "denied"); |
| 22 | 24 |
| 23 window.testRunner.grantWebNotificationPermission("file://", true
); | 25 testRunner.grantWebNotificationPermission("file://", true); |
| 24 shouldBeEqualToString("Notification.permission", "granted"); | 26 shouldBeEqualToString("Notification.permission", "granted"); |
| 25 } | 27 } |
| 26 </script> | 28 </script> |
| 27 </body> | 29 </body> |
| 28 </html> | 30 </html> |
| OLD | NEW |