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

Unified Diff: LayoutTests/fast/notifications/notification-exceptions.html

Issue 187323005: Revert of Remove support for legacy WebKit Notifications (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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/fast/notifications/notification-exceptions.html
diff --git a/LayoutTests/fast/notifications/notification-exceptions.html b/LayoutTests/fast/notifications/notification-exceptions.html
new file mode 100644
index 0000000000000000000000000000000000000000..8d0c0e6f5201bf2685ddce026e87e67dbd7f9a81
--- /dev/null
+++ b/LayoutTests/fast/notifications/notification-exceptions.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <script src="../../resources/js-test.js"></script>
+ <script>
+ description("The legacy notification constructor should throw exceptions in certain cases.");
+
+ // No permission grant; should throw SecurityError.
+ shouldThrow('window.webkitNotifications.createNotification("", "Title", "Message");', '"SecurityError: Failed to execute \'createNotification\' on \'NotificationCenter\': Notification permission has not been granted."');
+
+ // Invalid icon should throw SyntaxError.
+ testRunner.grantWebNotificationPermission("file://");
+ shouldThrow('window.webkitNotifications.createNotification("http:///", "Title", "Message");', '"SyntaxError: Failed to execute \'createNotification\' on \'NotificationCenter\': \'http:///\' is not a valid icon URL."');
+ </script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698