OLD | NEW |
| (Empty) |
1 #import('../../../../../dart/client/testing/unittest/unittest.dart'); | |
2 #import('dart:dom'); | |
3 | |
4 main() { | |
5 forLayoutTests(); | |
6 test('DOMException', () { | |
7 try { | |
8 window.webkitNotifications.createNotification('', '', ''); | |
9 } catch (DOMException e) { | |
10 Expect.equals(DOMException.SECURITY_ERR, e.code); | |
11 Expect.equals('SECURITY_ERR', e.name); | |
12 Expect.equals('SECURITY_ERR: DOM Exception 18', e.message); | |
13 } | |
14 }); | |
15 test('EventException', () { | |
16 final event = window.document.createEvent('Event'); | |
17 // Intentionally do not initialize it! | |
18 try { | |
19 window.document.dispatchEvent(event); | |
20 } catch (EventException e) { | |
21 Expect.equals(EventException.UNSPECIFIED_EVENT_TYPE_ERR, e.code); | |
22 Expect.equals('UNSPECIFIED_EVENT_TYPE_ERR', e.name); | |
23 Expect.equals('UNSPECIFIED_EVENT_TYPE_ERR: DOM Events Exception 0', e.mess
age); | |
24 } | |
25 }); | |
26 } | |
OLD | NEW |