OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Service Worker: notificationclick can focus WindowClient</title> | 2 <title>Service Worker: notificationclick can focus 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 testRunner.grantWebNotificationPermission(location.origin, true); | |
10 } | |
11 | 9 |
12 var t = async_test('notificationclick can focus WindowClient'); | 10 var t = async_test('notificationclick can focus WindowClient'); |
13 t.step(function() { | 11 t.step(function() { |
14 var scope = 'resources/blank.html' | 12 var scope = 'resources/blank.html' |
15 service_worker_unregister_and_register( | 13 service_worker_unregister_and_register( |
16 t, 'resources/notificationclick-can-focus.js', scope) | 14 t, 'resources/notificationclick-can-focus.js', scope) |
17 .then(function(registration) { | 15 .then(function(registration) { |
18 return wait_for_state(t, registration.installing, 'activated'); | 16 return wait_for_state(t, registration.installing, 'activated'); |
19 }) | 17 }) |
20 .then(function() { return with_iframe(scope); }) | 18 .then(function() { return with_iframe(scope); }) |
(...skipping 27 matching lines...) Expand all Loading... |
48 if (message === 'quit') { | 46 if (message === 'quit') { |
49 assert_array_equals(result, expected, | 47 assert_array_equals(result, expected, |
50 'Worker should post back expected messages.'); | 48 'Worker should post back expected messages.'); |
51 service_worker_unregister_and_done(t, scope); | 49 service_worker_unregister_and_done(t, scope); |
52 } else { | 50 } else { |
53 result.push(message); | 51 result.push(message); |
54 } | 52 } |
55 } | 53 } |
56 }); | 54 }); |
57 </script> | 55 </script> |
OLD | NEW |