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

Unified Diff: tests/html/notifications_test.dart

Issue 11883025: Detect if webkitNotifications is available and remove webkit prefix (replaced (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | « tests/html/html.status ('k') | tools/dom/scripts/generator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/notifications_test.dart
diff --git a/tests/html/notifications_test.dart b/tests/html/notifications_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..85612571d7a1a73f1487d0dcaeacc15f72747c9d
--- /dev/null
+++ b/tests/html/notifications_test.dart
@@ -0,0 +1,34 @@
+library NotificationsTest;
+import '../../pkg/unittest/lib/unittest.dart';
+import '../../pkg/unittest/lib/html_individual_config.dart';
+import 'dart:html';
+
+main() {
+ useHtmlIndividualConfiguration();
+
+ group('supported', () {
+ test('supported', () {
+ expect(NotificationCenter.supported, true);
+ });
+ });
+
+ group('unsupported throws', () {
+ test('createNotification', () {
+ var expectation = NotificationCenter.supported ? returnsNormally : throws;
+ expect(() { window.notifications.createNotification; }, expectation);
+ });
+ });
+
+ group('webkitNotifications', () {
+ if (NotificationCenter.supported) {
+ test('DomException', () {
+ try {
+ window.notifications.createNotification('', '', '');
+ } on DomException catch (e) {
+ expect(e.name, DomException.SECURITY);
+ }
+ });
+ }
+ });
+}
+
« no previous file with comments | « tests/html/html.status ('k') | tools/dom/scripts/generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698