064342cc5b
R=vsm@google.com Review URL: https://chromiumcodereview.appspot.com//10178014 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7124 260f80e4-7a28-3924-810f-c04153c831b5
29 lines
919 B
Dart
29 lines
919 B
Dart
#library('ExceptionsTest');
|
|
#import('../../lib/unittest/unittest.dart');
|
|
#import('../../lib/unittest/html_config.dart');
|
|
#import('dart:html');
|
|
|
|
main() {
|
|
useHtmlConfiguration();
|
|
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 = new Event('Event');
|
|
// Intentionally do not initialize it!
|
|
try {
|
|
document.$dom_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);
|
|
}
|
|
});
|
|
}
|