Files
sdk/tests/html/exceptions_test.dart
T
blois@google.com d2aa044d2b Deprecating old DOM event APIs.
This also exposes EventTarget.dispatchEvent. We had discussed naming this as 'dispatch', but it seems a bit safer to use 'dispatchEvent' to avoid potential name conflicts.

BUG=

Review URL: https://codereview.chromium.org//12047054

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17595 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-24 19:42:02 +00:00

19 lines
445 B
Dart

library ExceptionsTest;
import '../../pkg/unittest/lib/unittest.dart';
import '../../pkg/unittest/lib/html_config.dart';
import 'dart:html';
main() {
useHtmlConfiguration();
test('EventException', () {
final event = new Event('Event');
// Intentionally do not initialize it!
try {
document.dispatchEvent(event);
} on EventException catch (e) {
expect(e.name, DomException.UNSPECIFIED_EVENT_TYPE);
}
});
}