Index: client/tests/client/dom/ExceptionsTest.dart |
diff --git a/client/tests/client/dom/ExceptionsTest.dart b/client/tests/client/dom/ExceptionsTest.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..508e9fe5a4b07c8713f6e897f40dca02c4ea7f01 |
--- /dev/null |
+++ b/client/tests/client/dom/ExceptionsTest.dart |
@@ -0,0 +1,27 @@ |
+#library('ExceptionsTest'); |
+#import('../../../testing/unittest/unittest.dart'); |
+#import('dart:dom'); |
+ |
+main() { |
+ forLayoutTests(); |
+ test('DOMException', () { |
+ try { |
+ window.webkitNotifications.createNotification('', '', ''); |
+ } catch (DOMException e) { |
+ Expect.equals(DOMException.SECURITY_ERR, e.code); |
+ Expect.equals('SECURITY_ERR', e.name); |
+ Expect.equals('SECURITY_ERR: DOM Exception 18', e.message); |
+ } |
+ }); |
+ test('EventException', () { |
+ final event = window.document.createEvent('Event'); |
+ // Intentionally do not initialize it! |
+ try { |
+ window.document.dispatchEvent(event); |
+ } catch (EventException e) { |
+ Expect.equals(EventException.UNSPECIFIED_EVENT_TYPE_ERR, e.code); |
+ Expect.equals('UNSPECIFIED_EVENT_TYPE_ERR', e.name); |
+ Expect.equals('UNSPECIFIED_EVENT_TYPE_ERR: DOM Events Exception 0', e.message); |
+ } |
+ }); |
+} |