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

Side by Side Diff: tests/html/element_constructor_1_test.dart

Issue 11275054: Modified unittest to use new argument syntax. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Put universally passing event constructors in this file. 5 // Put universally passing event constructors in this file.
6 // Move constructors that fail on some configuration to their own 6 // Move constructors that fail on some configuration to their own
7 // element_constructor_foo_test.dart file. 7 // element_constructor_foo_test.dart file.
8 8
9 #library('ElementConstructorTest'); 9 #library('ElementConstructorTest');
10 #import('../../pkg/unittest/unittest.dart'); 10 #import('../../pkg/unittest/unittest.dart');
11 #import('../../pkg/unittest/html_config.dart'); 11 #import('../../pkg/unittest/html_config.dart');
12 #import('dart:html'); 12 #import('dart:html');
13 13
14 main() { 14 main() {
15 useHtmlConfiguration(); 15 useHtmlConfiguration();
16 16
17 var isAnchorElement =
18 predicate((x) => x is AnchorElement, 'is an AnchorElement');
19 var isAreaElement =
20 predicate((x) => x is AreaElement, 'is an AreaElement');
21 var isDivElement = predicate((x) => x is DivElement, 'is a DivElement');
22 var isCanvasElement =
23 predicate((x) => x is CanvasElement, 'is a CanvasElement');
24 var isParagraphElement =
25 predicate((x) => x is ParagraphElement, 'is a ParagraphElement');
26 var isSpanElement = predicate((x) => x is SpanElement, 'is a SpanElement');
27 var isSelectElement =
28 predicate((x) => x is SelectElement, 'is a SelectElement');
29
17 test('anchor1', () { 30 test('anchor1', () {
18 var e = new AnchorElement(); 31 var e = new AnchorElement();
19 Expect.isTrue(e is AnchorElement); 32 expect(e, isAnchorElement);
20 }); 33 });
21 34
22 test('anchor2', () { 35 test('anchor2', () {
23 var e = new AnchorElement(href: '#blah'); 36 var e = new AnchorElement(href: '#blah');
24 Expect.isTrue(e is AnchorElement); 37 expect(e, isAnchorElement);
25 Expect.isTrue(e.href.endsWith('#blah')); 38 expect(e.href, endsWith('#blah'));
26 }); 39 });
27 40
28 test('area', () { 41 test('area', () {
29 var e = new AreaElement(); 42 var e = new AreaElement();
30 Expect.isTrue(e is AreaElement); 43 expect(e, isAreaElement);
31 }); 44 });
32 45
33 // AudioElement tested in audioelement_test.dart 46 // AudioElement tested in audioelement_test.dart
34 47
35 test('div', () { 48 test('div', () {
36 var e = new DivElement(); 49 var e = new DivElement();
37 Expect.isTrue(e is DivElement); 50 expect(e, isDivElement);
38 }); 51 });
39 52
40 test('canvas1', () { 53 test('canvas1', () {
41 var e = new CanvasElement(); 54 var e = new CanvasElement();
42 Expect.isTrue(e is CanvasElement); 55 expect(e, isCanvasElement);
43 }); 56 });
44 57
45 test('canvas2', () { 58 test('canvas2', () {
46 var e = new CanvasElement(height: 100, width: 200); 59 var e = new CanvasElement(height: 100, width: 200);
47 Expect.isTrue(e is CanvasElement); 60 expect(e, isCanvasElement);
48 Expect.equals(200, e.width); 61 expect(e.width, 200);
49 Expect.equals(100, e.height); 62 expect(e.height, 100);
50 }); 63 });
51 64
52 test('p', () { 65 test('p', () {
53 var e = new ParagraphElement(); 66 var e = new ParagraphElement();
54 Expect.isTrue(e is ParagraphElement); 67 expect(e, isParagraphElement);
55 }); 68 });
56 69
57 test('span', () { 70 test('span', () {
58 var e = new SpanElement(); 71 var e = new SpanElement();
59 Expect.isTrue(e is SpanElement); 72 expect(e, isSpanElement);
60 }); 73 });
61 74
62 test('select', () { 75 test('select', () {
63 var e = new SelectElement(); 76 var e = new SelectElement();
64 Expect.isTrue(e is SelectElement); 77 expect(e, isSelectElement);
65 }); 78 });
66 } 79 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698