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

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

Issue 11184007: Support new named arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 // 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 test('anchor1', () { 17 test('anchor1', () {
18 var e = new AnchorElement(); 18 var e = new AnchorElement();
19 Expect.isTrue(e is AnchorElement); 19 Expect.isTrue(e is AnchorElement);
20 }); 20 });
21 21
22 test('anchor2', () { 22 test('anchor2', () {
23 var e = new AnchorElement(href: '#blah'); 23 // OPTIONALS var e = new AnchorElement(href: '#blah');
24 var e = new AnchorElement('#blah');
24 Expect.isTrue(e is AnchorElement); 25 Expect.isTrue(e is AnchorElement);
25 Expect.isTrue(e.href.endsWith('#blah')); 26 Expect.isTrue(e.href.endsWith('#blah'));
26 }); 27 });
27 28
28 test('area', () { 29 test('area', () {
29 var e = new AreaElement(); 30 var e = new AreaElement();
30 Expect.isTrue(e is AreaElement); 31 Expect.isTrue(e is AreaElement);
31 }); 32 });
32 33
33 // AudioElement tested in audioelement_test.dart 34 // AudioElement tested in audioelement_test.dart
34 35
35 test('div', () { 36 test('div', () {
36 var e = new DivElement(); 37 var e = new DivElement();
37 Expect.isTrue(e is DivElement); 38 Expect.isTrue(e is DivElement);
38 }); 39 });
39 40
40 test('canvas1', () { 41 test('canvas1', () {
41 var e = new CanvasElement(); 42 var e = new CanvasElement();
42 Expect.isTrue(e is CanvasElement); 43 Expect.isTrue(e is CanvasElement);
43 }); 44 });
44 45
45 test('canvas2', () { 46 test('canvas2', () {
46 var e = new CanvasElement(height: 100, width: 200); 47 // OPTIONALS var e = new CanvasElement(height: 100, width: 200);
48 var e = new CanvasElement(200, 100);
47 Expect.isTrue(e is CanvasElement); 49 Expect.isTrue(e is CanvasElement);
48 Expect.equals(200, e.width); 50 Expect.equals(200, e.width);
49 Expect.equals(100, e.height); 51 Expect.equals(100, e.height);
50 }); 52 });
51 53
52 test('p', () { 54 test('p', () {
53 var e = new ParagraphElement(); 55 var e = new ParagraphElement();
54 Expect.isTrue(e is ParagraphElement); 56 Expect.isTrue(e is ParagraphElement);
55 }); 57 });
56 58
57 test('span', () { 59 test('span', () {
58 var e = new SpanElement(); 60 var e = new SpanElement();
59 Expect.isTrue(e is SpanElement); 61 Expect.isTrue(e is SpanElement);
60 }); 62 });
61 63
62 test('select', () { 64 test('select', () {
63 var e = new SelectElement(); 65 var e = new SelectElement();
64 Expect.isTrue(e is SelectElement); 66 Expect.isTrue(e is SelectElement);
65 }); 67 });
66 } 68 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698