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

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

Issue 10448009: Apply html renames to native wrappers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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
« lib/dom/scripts/systemhtml.py ('K') | « tests/html/element_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #library('ElementTest'); 1 #library('ElementTest');
2 #import('../../lib/unittest/unittest.dart'); 2 #import('../../lib/unittest/unittest.dart');
3 #import('../../lib/unittest/html_config.dart'); 3 #import('../../lib/unittest/html_config.dart');
4 #import('dart:html'); 4 #import('dart:html');
5 5
6 main() { 6 main() {
7 useHtmlConfiguration(); 7 useHtmlConfiguration();
8 test('InnerHTML', () { 8 test('InnerHTML', () {
9 Element element = new Element.tag('div'); 9 Element element = new Element.tag('div');
10 element.id = 'test'; 10 element.id = 'test';
11 element.innerHTML = 'Hello World'; 11 element.innerHTML = 'Hello World';
12 document.body.nodes.add(element); 12 document.body.nodes.add(element);
13 13
14 element = document.query('#test'); 14 element = document.query('#test');
15 Expect.stringEquals('Hello World', element.innerHTML); 15 Expect.stringEquals('Hello World', element.innerHTML);
16 element.remove(); 16 element.remove();
17 }); 17 });
18 test('HTMLTable', () { 18 test('HTMLTable', () {
19 Element table = new Element.tag('table'); 19 Element table = new Element.tag('table');
20 20
21 TableRowElement row = new Element.tag('tr'); 21 TableRowElement row = new Element.tag('tr');
22 table.nodes.add(row); 22 table.nodes.add(row);
23 23
24 row.nodes.add(new Element.tag('td')); 24 row.nodes.add(new Element.tag('td'));
25 row.nodes.add(new Element.tag('td')); 25 row.nodes.add(new Element.tag('td'));
26 26
27 Expect.equals(2, row.cells.length); 27 Expect.equals(2, row.cells.length);
28 28
29 TableRowElement headerRow = table.rows.item(0); 29 TableRowElement headerRow = table.rows[0];
30 Expect.equals(2, headerRow.cells.length); 30 Expect.equals(2, headerRow.cells.length);
31 }); 31 });
32 test('dataAttributes', () { 32 test('dataAttributes', () {
33 Element div = new Element.tag('div'); 33 Element div = new Element.tag('div');
34 34
35 Expect.isTrue(div.dataAttributes.isEmpty()); 35 Expect.isTrue(div.dataAttributes.isEmpty());
36 Expect.equals(null, div.dataAttributes['foo']); 36 Expect.equals(null, div.dataAttributes['foo']);
37 Expect.isTrue(div.dataAttributes.isEmpty()); 37 Expect.isTrue(div.dataAttributes.isEmpty());
38 38
39 div.dataAttributes['foo'] = 'foo-value'; 39 div.dataAttributes['foo'] = 'foo-value';
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 Expect.equals('foo-value', div.dataAttributes.remove('foo')); 83 Expect.equals('foo-value', div.dataAttributes.remove('foo'));
84 Expect.equals(1, div.dataAttributes.length); 84 Expect.equals(1, div.dataAttributes.length);
85 Expect.isFalse(div.dataAttributes.isEmpty()); 85 Expect.isFalse(div.dataAttributes.isEmpty());
86 86
87 div.dataAttributes.clear(); 87 div.dataAttributes.clear();
88 Expect.equals(0, div.dataAttributes.length); 88 Expect.equals(0, div.dataAttributes.length);
89 Expect.isTrue(div.dataAttributes.isEmpty()); 89 Expect.isTrue(div.dataAttributes.isEmpty());
90 }); 90 });
91 } 91 }
OLDNEW
« lib/dom/scripts/systemhtml.py ('K') | « tests/html/element_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698