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

Side by Side Diff: LayoutTests/http/tests/notifications/serviceworkerregistration-show-notification.html

Issue 717273002: Implement the ServiceWorkerRegistration.showNotification() method. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: adds a test Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <title>Notifications: ServiceWorkerRegistration.showNotification().</title>
5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharnessreport.js"></script>
7 <script src="../serviceworker/resources/test-helpers.js"></script>
8 </head>
9 <body>
10 <script>
11 // Tests that the showNotification() function is exposed on the ServiceWor kerRegistration
12 // object. As of right now, this is only exposed in documents.
13 async_test(function (test) {
14 var scope = 'resources/scope/serviceworkerregistration-show-notificati on',
15 worker_url = 'resources/empty-worker.js';
mlamouri (slow - plz ping) 2014/11/13 21:08:02 nit: you might want that to not be notifications/
16
17 service_worker_unregister_and_register(test, worker_url, scope).then(f unction (registration) {
18 assert_inherits(registration, 'showNotification', 'showNotificatio n() must be exposed.');
19 registration.showNotification('Title', {
20 body: 'Hello, world!',
21 icon: '/icon.png'
22 }).then(function() {
23 assert_unreached('showNotification() is expected to reject.');
24 }).catch(test.step_func_done());
25
26 }).catch(unreached_rejection(test));
27
28 }, 'showNotification() must be exposed on the Document-based ServiceWorker Registration.');
29 </script>
30 </body>
31 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698