| Index: LayoutTests/http/tests/notifications/service-worker-show-notification-close.html
|
| diff --git a/LayoutTests/http/tests/notifications/service-worker-show-notification-click.html b/LayoutTests/http/tests/notifications/service-worker-show-notification-close.html
|
| similarity index 76%
|
| copy from LayoutTests/http/tests/notifications/service-worker-show-notification-click.html
|
| copy to LayoutTests/http/tests/notifications/service-worker-show-notification-close.html
|
| index 37ffa0c859ea42d2e5cebb40924d93b0386a61db..b44c49a0dd8c83e9c83ae55e20f44c899b9d812d 100644
|
| --- a/LayoutTests/http/tests/notifications/service-worker-show-notification-click.html
|
| +++ b/LayoutTests/http/tests/notifications/service-worker-show-notification-close.html
|
| @@ -8,12 +8,13 @@
|
| </head>
|
| <body>
|
| <script>
|
| - // Tests that the showNotification() function resolves a promise, and that the
|
| + // Tests that the showNotification() function resolves a promise, that the
|
| // notificationclick event gets fired on the Service Worker when we simulate a
|
| - // click on it. This test requires the test runner.
|
| + // click on it, and the notification can then be closed. This test requires
|
| + // the test runner.
|
| async_test(function (test) {
|
| - var scope = 'resources/scope/service-worker-show-notification-click',
|
| - workerUrl = 'resources/click-forward-service-worker.js';
|
| + var scope = 'resources/scope/service-worker-show-notification-close',
|
| + workerUrl = 'resources/click-close-service-worker.js';
|
|
|
| testRunner.grantWebNotificationPermission(location.origin, true);
|
|
|
| @@ -44,15 +45,20 @@
|
| });
|
| }).then(function () {
|
| messagePort.addEventListener('message', function(event) {
|
| - assert_equals(event.data, 'The notification has been clicked on.');
|
| - test.done();
|
| + assert_equals(event.data, 'Clicked on Notification: ' + scope);
|
| +
|
| + // FIXME: The notification has now been closed by the Service Worker. In
|
| + // order to verify that this works correctly, we need to support the
|
| + // Notification.get() getter, which is not implemented yet.
|
| +
|
| + service_worker_unregister_and_done(test, scope);
|
| });
|
|
|
| testRunner.simulateWebNotificationClick(scope);
|
|
|
| }).catch(unreached_rejection(test));
|
|
|
| - }, 'Clicking on a notification displayed through showNotification() fires a Service Worker event.');
|
| + }, 'Clicking on a notification displayed through showNotification() fires a Service Worker event, and can be closed there.');
|
| </script>
|
| </body>
|
| </html>
|
|
|