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

Unified Diff: chrome/test/data/notifications/platform_notification_service.html

Issue 1019803002: Add browser tests for loading notification icons from blob and data URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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 | « chrome/browser/notifications/platform_notification_service_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/notifications/platform_notification_service.html
diff --git a/chrome/test/data/notifications/platform_notification_service.html b/chrome/test/data/notifications/platform_notification_service.html
index 3c6ea37e2ad2376eaa6bcf2984f773bde2b6147d..7c4eb868001c1989361f636c144294610290a3ca 100644
--- a/chrome/test/data/notifications/platform_notification_service.html
+++ b/chrome/test/data/notifications/platform_notification_service.html
@@ -58,6 +58,34 @@
});
}
+ // Displays a persistent notification with a data: URL as its image.
+ function DisplayPersistentNotificationDataUrlImage() {
+ fetch('icon.png').then(function(response) {
+ return response.blob();
+ }).then(function(blob) {
+ var reader = new FileReader();
+ reader.readAsDataURL(blob);
+ reader.onloadend = function() {
+ DisplayPersistentNotification('Data URL Title', {
+ body: 'Contents',
+ icon: reader.result
+ });
+ };
+ });
+ }
+
+ // Displays a persistent notification with a blob URL as its image.
+ function DisplayPersistentNotificationBlobImage() {
+ fetch('icon.png').then(function(response) {
+ return response.blob();
+ }).then(function(blob) {
+ DisplayPersistentNotification('Blob Title', {
+ body: 'Contents',
+ icon: URL.createObjectURL(blob)
+ });
+ });
+ }
+
// Returns the latest received message from the worker. If no message has
// been received, nothing will be done. For successfully registered
// Service Workers this is OK, however, since the "message" event handler
« no previous file with comments | « chrome/browser/notifications/platform_notification_service_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698