Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notificationclose-event-data-reflection.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notificationclick-event-data-reflection.html b/third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notificationclose-event-data-reflection.html |
| similarity index 81% |
| copy from third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notificationclick-event-data-reflection.html |
| copy to third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notificationclose-event-data-reflection.html |
| index 693f0ac6eeabfe5133ff46f6e17889ef50b845c6..9d2a4c66667207ead7a4c1a401431657deb2aac6 100644 |
| --- a/third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notificationclick-event-data-reflection.html |
| +++ b/third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notificationclose-event-data-reflection.html |
| @@ -1,7 +1,7 @@ |
| <!doctype html> |
| <html> |
| <head> |
| - <title>Notifications: data property reflection in the "notificationclick" event.</title> |
| + <title>Notifications: Action reflection in the "notificationclose" event.</title> |
| <script src="../resources/testharness.js"></script> |
| <script src="../resources/testharnessreport.js"></script> |
| <script src="../serviceworker/resources/test-helpers.js"></script> |
| @@ -9,9 +9,8 @@ |
| </head> |
| <body> |
| <script> |
| - // Tests that the notification available in the "notificationclick" event in the |
| - // Service Worker accurately reflects the data attributes of several type |
| - // with which the notification was created (for this test --) in the document. |
| + // Tests that the action property of the "notificationclose" event in the |
| + // Service Worker accurately reflects which action was activated, if any. |
| async_test(function(test) { |
| var scope = 'resources/scope/' + location.pathname, |
| @@ -54,14 +53,14 @@ |
| // notification's display promise has been resolved. |
| if (event.data.command == 'show') { |
| assert_true(event.data.success, 'The notification must have been displayed.'); |
| - testRunner.simulateWebNotificationClick(scope, -1 /* action_index */); |
|
Peter Beverloo
2016/02/02 23:50:10
Can we perhaps generalize the data reflection test
Nina
2016/02/03 15:04:23
I refactored the logic into a different file and e
|
| + testRunner.simulateWebNotificationClose(scope, true /* by_user */); |
| return; |
| } |
| // (3) Listen for confirmation from the Service Worker that the |
| - // notification has been clicked on. Make sure that all properties |
| + // notification has been closed. Make sure that all properties |
| // set on the Notification object are as expected. |
| - assert_equals(event.data.command, 'click', 'The notification was expected to be clicked.'); |
| + assert_equals(event.data.command, 'close', 'The notification was expected to be closed.'); |
| var pos = event.data.notification.tag; |
| @@ -79,7 +78,7 @@ |
| assertNotificationDataReflects(0); |
| }).catch(unreached_rejection(test)); |
| - }, 'Clicking on a notification displayed by a Service Worker the notificationclick event.'); |
| + }, 'NotificationEvent data property should be reflected when the notification is closed by the user.'); |
| </script> |
| </body> |
| </html> |