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

Unified Diff: LayoutTests/http/tests/notifications/serviceworkerregistration-document-image-slow.html

Issue 933153003: Add some image loading layout tests for Web Notifications. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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-document-image-slow.html
diff --git a/LayoutTests/http/tests/notifications/serviceworkerregistration-document-image-slow.html b/LayoutTests/http/tests/notifications/serviceworkerregistration-document-image-slow.html
new file mode 100644
index 0000000000000000000000000000000000000000..e4b81c23d5a18220a9769b0f993a2a6d4fea839f
--- /dev/null
+++ b/LayoutTests/http/tests/notifications/serviceworkerregistration-document-image-slow.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Notifications: Showing a notification with an image that 404s.</title>
Michael van Ouwerkerk 2015/02/19 11:41:46 nit: update title
Peter Beverloo 2015/02/19 12:03:54 Done.
+ <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 showing a notification with an image that takes a non-trivial
+ // time to load still ends up resolving the promise.
+
+ async_test(function(test) {
+ var scope = 'resources/scope/' + location.pathname,
+ script = 'resources/instrumentation-service-worker.js';
+
+ testRunner.grantWebNotificationPermission(location.origin, true);
+ getActiveServiceWorkerWithMessagePort(test, script, scope).then(function(info) {
+ // (1) Display a Web Notification with an image that takes 200ms to load.
+ return info.registration.showNotification(scope, {
+ body: 'Hello, world!',
+ icon: '/resources/slow-image.php?redirect_name=square100.png&mimeType=image/png&sleep=200'
+ });
+ }).then(function() {
+ test.done();
+ }).catch(unreached_rejection(test));
+
+ }, 'Displaying a notification with an image that takes some time to load still resolves the promise.');
+ </script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698