| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Notifications: Simulating a click should call the onclick event.</tit
le> | 4 <title>Notifications: Should be able to focus window in onclick event.</titl
e> |
| 5 <script src="../resources/testharness.js"></script> | 5 <script src="../resources/testharness.js"></script> |
| 6 <script src="../resources/testharnessreport.js"></script> | 6 <script src="../resources/testharnessreport.js"></script> |
| 7 </head> | 7 </head> |
| 8 <body> | 8 <body> |
| 9 <script> | 9 <script> |
| 10 // Tests that Document-bound notifications are able to focus a window in | 10 // Tests that Document-bound notifications are able to focus a window in |
| 11 // their onclick event. When the test is being ran manually, grant | 11 // their onclick event. When the test is being run manually, grant |
| 12 // Notification permission and click on the notification. | 12 // Notification permission and click on the notification. |
| 13 if (window.testRunner) { | 13 if (window.testRunner) { |
| 14 testRunner.setCanOpenWindows(); | 14 testRunner.setCanOpenWindows(); |
| 15 testRunner.setCloseRemainingWindowsWhenComplete(); | 15 testRunner.setCloseRemainingWindowsWhenComplete(); |
| 16 testRunner.setPermission('notifications', 'granted', location.origin,
location.origin); | 16 testRunner.setPermission('notifications', 'granted', location.origin,
location.origin); |
| 17 } | 17 } |
| 18 | 18 |
| 19 async_test(function(test) { | 19 async_test(function(test) { |
| 20 if (Notification.permission != 'granted') { | 20 if (Notification.permission != 'granted') { |
| 21 assert_unreached('No permission has been granted for displaying no
tifications.'); | 21 assert_unreached('No permission has been granted for displaying no
tifications.'); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 notification.addEventListener('error', function() { | 42 notification.addEventListener('error', function() { |
| 43 assert_unreached('The error event should not be thrown.'); | 43 assert_unreached('The error event should not be thrown.'); |
| 44 }); | 44 }); |
| 45 | 45 |
| 46 }, 'Clicking on a notification enables it to focus the window it was creat
ed from.'); | 46 }, 'Clicking on a notification enables it to focus the window it was creat
ed from.'); |
| 47 </script> | 47 </script> |
| 48 <script src="resources/click-focus-test.js"></script> | 48 <script src="resources/click-focus-test.js"></script> |
| 49 </body> | 49 </body> |
| 50 </html> | 50 </html> |
| OLD | NEW |