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