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

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: update the webexposed test 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
« no previous file with comments | « no previous file | LayoutTests/webexposed/global-interface-listing-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6e389adae32105b1579d43ab9c854eb52ca3944d
--- /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/instrumentation-service-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 | LayoutTests/webexposed/global-interface-listing-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698