Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Unified Diff: LayoutTests/http/tests/notifications/service-worker-show-notification-close.html

Issue 789643003: The Service Worker notificationclick event should carry a notification. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add missing file Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 79%
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 132e67d3aecd591d74e05e40bc9aef0bfbdc186d..cdc9de659c783da6587f6af017217ff2af5a59e4 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',
- worker_url = 'resources/click-forward-service-worker.js';
+ var scope = 'resources/scope/service-worker-show-notification-close',
+ worker_url = 'resources/click-close-service-worker.js';
testRunner.grantWebNotificationPermission("http://127.0.0.1:8000", true);
@@ -47,7 +48,12 @@
});
}).then(function () {
messagePort.addEventListener('message', function(event) {
- assert_equals(event.data, 'The notification has been clicked on.');
+ assert_equals(event.data, 'Clicked on Notificationx: ' + scope);
Michael van Ouwerkerk 2014/12/09 19:49:20 This is not the data sent, with "Notificationx".
Peter Beverloo 2014/12/10 14:11:09 Done.
+
+ // 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.
+
test.done();
});
@@ -55,7 +61,7 @@
}).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>

Powered by Google App Engine
This is Rietveld 408576698