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

Unified Diff: LayoutTests/http/tests/notifications/resources/serviceworker-notification-constructor.js

Issue 923443005: Disallow constructing the Notification object in a Service Worker. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: comments 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/notifications/resources/serviceworker-notification-event.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/notifications/resources/serviceworker-notification-constructor.js
diff --git a/LayoutTests/http/tests/notifications/resources/serviceworker-notification-constructor.js b/LayoutTests/http/tests/notifications/resources/serviceworker-notification-constructor.js
new file mode 100644
index 0000000000000000000000000000000000000000..7294592935350ec33d2e60d09a1f48ec6e225657
--- /dev/null
+++ b/LayoutTests/http/tests/notifications/resources/serviceworker-notification-constructor.js
@@ -0,0 +1,11 @@
+importScripts('../../serviceworker/resources/worker-testharness.js');
+importScripts('../../resources/testharness-helpers.js');
+
+test(function() {
+ assert_true('Notification' in self);
+
+ assert_throws({ name: 'TypeError' }, function() {
+ new Notification();
+ });
+
+}, 'Constructing a Notification object in a Service Worker throws.');
« no previous file with comments | « no previous file | LayoutTests/http/tests/notifications/resources/serviceworker-notification-event.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698