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

Unified Diff: LayoutTests/http/tests/notifications/serviceworkerregistration-get-empty.html

Issue 1016843002: Implement the ServiceWorkerRegistration.getNotifications() API. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 months 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/serviceworkerregistration-get-empty.html
diff --git a/LayoutTests/http/tests/notifications/serviceworkerregistration-get-empty.html b/LayoutTests/http/tests/notifications/serviceworkerregistration-get-empty.html
new file mode 100644
index 0000000000000000000000000000000000000000..f6e5de80433de276d7fa17ff8167a02e41bcfc69
--- /dev/null
+++ b/LayoutTests/http/tests/notifications/serviceworkerregistration-get-empty.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Notifications: ServiceWorkerRegistration.getNotifications() with no notifications.</title>
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ <script src="../serviceworker/resources/test-helpers.js"></script>
+ <script src="resources/test-helpers.js"></script>
+ </head>
+ <body>
+ <script>
+ // Tests that the getNotifications() function when used in a document without
+ // notifications returns a promise that gets resolved with an empty array.
+ async_test(function(test) {
+ var scope = 'resources/scope/' + location.pathname,
+ script = 'resources/empty-worker.js';
+
+ getActiveServiceWorkerWithMessagePort(test, script, scope).then(function(workerInfo) {
+ return workerInfo.registration.getNotifications();
+ }).then(function(notifications) {
+ assert_array_equals(notifications, []);
+ test.done();
+ }).catch(unreached_rejection(test));
+
+ }, 'ServiceWorkerRegistration.getNotifications() with no notifications.');
+ </script>
+ </body>
+</html>
« no previous file with comments | « no previous file | Source/modules/modules.gypi » ('j') | Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698