Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: client/tests/client/dom/ExceptionsTest.dart

Issue 10037027: unittest step2: bye bye to multiple entrypoints for unittest (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #library('ExceptionsTest'); 1 #library('ExceptionsTest');
2 #import('../../../../lib/unittest/unittest_dom.dart'); 2 #import('../../../../lib/unittest/unittest.dart');
3 #import('../../../../lib/unittest/dom_config.dart');
3 #import('dart:dom'); 4 #import('dart:dom');
4 5
5 main() { 6 main() {
6 forLayoutTests(); 7 useDomConfiguration(isLayoutTest: true);
7 test('DOMException', () { 8 test('DOMException', () {
8 try { 9 try {
9 window.webkitNotifications.createNotification('', '', ''); 10 window.webkitNotifications.createNotification('', '', '');
10 } catch (DOMException e) { 11 } catch (DOMException e) {
11 Expect.equals(DOMException.SECURITY_ERR, e.code); 12 Expect.equals(DOMException.SECURITY_ERR, e.code);
12 Expect.equals('SECURITY_ERR', e.name); 13 Expect.equals('SECURITY_ERR', e.name);
13 Expect.equals('SECURITY_ERR: DOM Exception 18', e.message); 14 Expect.equals('SECURITY_ERR: DOM Exception 18', e.message);
14 } 15 }
15 }); 16 });
16 test('EventException', () { 17 test('EventException', () {
17 final event = window.document.createEvent('Event'); 18 final event = window.document.createEvent('Event');
18 // Intentionally do not initialize it! 19 // Intentionally do not initialize it!
19 try { 20 try {
20 window.document.dispatchEvent(event); 21 window.document.dispatchEvent(event);
21 } catch (EventException e) { 22 } catch (EventException e) {
22 Expect.equals(EventException.UNSPECIFIED_EVENT_TYPE_ERR, e.code); 23 Expect.equals(EventException.UNSPECIFIED_EVENT_TYPE_ERR, e.code);
23 Expect.equals('UNSPECIFIED_EVENT_TYPE_ERR', e.name); 24 Expect.equals('UNSPECIFIED_EVENT_TYPE_ERR', e.name);
24 Expect.equals('UNSPECIFIED_EVENT_TYPE_ERR: DOM Events Exception 0', e.mess age); 25 Expect.equals('UNSPECIFIED_EVENT_TYPE_ERR: DOM Events Exception 0', e.mess age);
25 } 26 }
26 }); 27 });
27 } 28 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698