| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Service Worker: notificationclick can open new WindowClient</title> | 2 <title>Service Worker: notificationclick can open new WindowClient</title> |
| 3 <script src="../../resources/testharness.js"></script> | 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> | 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <script src="../resources/test-helpers.js"></script> | 5 <script src="../resources/test-helpers.js"></script> |
| 6 <script> | 6 <script> |
| 7 if (window.testRunner) | 7 if (window.testRunner) |
| 8 testRunner.setPermission('notifications', 'granted', location.origin, locati
on.origin); | 8 testRunner.setPermission('notifications', 'granted', location.origin, locati
on.origin); |
| 9 | 9 |
| 10 var t = async_test('notificationclick can open new WindowClient'); | 10 var t = async_test('notificationclick can open new WindowClient'); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 'openWindow() failed after timeout', | 32 'openWindow() failed after timeout', |
| 33 'openWindow() failed because a window was focused before']; | 33 'openWindow() failed because a window was focused before']; |
| 34 | 34 |
| 35 function onMessage(e) { | 35 function onMessage(e) { |
| 36 var message = e.data; | 36 var message = e.data; |
| 37 | 37 |
| 38 if (typeof(message) === 'object') { | 38 if (typeof(message) === 'object') { |
| 39 if (message.type !== 'click') | 39 if (message.type !== 'click') |
| 40 return; | 40 return; |
| 41 if (window.testRunner) | 41 if (window.testRunner) |
| 42 testRunner.simulateWebNotificationClick(message.title); | 42 testRunner.simulateWebNotificationClick(message.title, -1 /* action_in
dex */); |
| 43 return; | 43 return; |
| 44 } | 44 } |
| 45 | 45 |
| 46 if (message === 'quit') { | 46 if (message === 'quit') { |
| 47 assert_array_equals(result, expected, | 47 assert_array_equals(result, expected, |
| 48 'Worker should post back expected messages.'); | 48 'Worker should post back expected messages.'); |
| 49 service_worker_unregister_and_done(t, scope); | 49 service_worker_unregister_and_done(t, scope); |
| 50 } else { | 50 } else { |
| 51 result.push(message); | 51 result.push(message); |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 }); | 54 }); |
| 55 </script> | 55 </script> |
| OLD | NEW |