OLD | NEW |
| (Empty) |
1 #library("dom-attr.dart"); | |
2 #import("dart:dom"); | |
3 #import('runner.dart'); | |
4 | |
5 void main() { | |
6 final int num = 10240; | |
7 | |
8 // Try to force real results. | |
9 var ret; | |
10 | |
11 HTMLElement elem = document.getElementById('test1'); | |
12 HTMLElement a = document.getElementsByTagName('a')[0]; | |
13 | |
14 new Suite(window, 'dom-attr') | |
15 .test('getAttribute', void _() { | |
16 for (int i = 0; i < num; i++) | |
17 ret = elem.getAttribute('id'); | |
18 }) | |
19 .test('element.property', () { | |
20 for (int i = 0; i < num * 2; i++) | |
21 ret = elem.id; | |
22 }) | |
23 .test('setAttribute', () { | |
24 for (int i = 0; i < num; i++) | |
25 a.setAttribute('id', 'foo'); | |
26 }) | |
27 .test('element.property = value', () { | |
28 for (int i = 0; i < num; i++) | |
29 a.id = 'foo'; | |
30 }) | |
31 .end(); | |
32 } | |
OLD | NEW |