OLD | NEW |
1 library dromaeo; | 1 library dromaeo; |
2 import 'dart:async'; | 2 import 'dart:async'; |
3 import 'dart:html'; | 3 import 'dart:html'; |
4 import "dart:convert"; | 4 import "dart:convert"; |
5 import '../common/common.dart'; | 5 import '../common/common.dart'; |
6 import 'dart:math' as Math; | 6 import 'dart:math' as Math; |
7 part 'Common.dart'; | 7 part 'Common.dart'; |
8 part 'RunnerSuite.dart'; | 8 part 'RunnerSuite.dart'; |
9 | 9 |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 }); | 27 }); |
28 html = BenchUtil.replaceAll(html, 'class="foo.*?"', (Match match) { | 28 html = BenchUtil.replaceAll(html, 'class="foo.*?"', (Match match) { |
29 return 'class="foo test${num} bar"'; | 29 return 'class="foo test${num} bar"'; |
30 }); | 30 }); |
31 | 31 |
32 final div = new Element.tag('div'); | 32 final div = new Element.tag('div'); |
33 div.innerHtml = html; | 33 div.innerHtml = html; |
34 document.body.append(div); | 34 document.body.append(div); |
35 }) | 35 }) |
36 .test('firstChild', () { | 36 .test('firstChild', () { |
37 final nodes = document.body.$dom_childNodes; | 37 final nodes = document.body.nodes; |
38 final nl = nodes.length; | 38 final nl = nodes.length; |
39 | 39 |
40 for (int i = 0; i < num; i++) { | 40 for (int i = 0; i < num; i++) { |
41 for (int j = 0; j < nl; j++) { | 41 for (int j = 0; j < nl; j++) { |
42 Node cur = nodes[j]; | 42 Node cur = nodes[j]; |
43 while (cur != null) { | 43 while (cur != null) { |
44 cur = cur.firstChild; | 44 cur = cur.firstChild; |
45 } | 45 } |
46 ret = cur; | 46 ret = cur; |
47 } | 47 } |
48 } | 48 } |
49 }) | 49 }) |
50 .test('lastChild', () { | 50 .test('lastChild', () { |
51 final nodes = document.body.$dom_childNodes; | 51 final nodes = document.body.nodes; |
52 final nl = nodes.length; | 52 final nl = nodes.length; |
53 | 53 |
54 for (int i = 0; i < num; i++) { | 54 for (int i = 0; i < num; i++) { |
55 for (int j = 0; j < nl; j++) { | 55 for (int j = 0; j < nl; j++) { |
56 Node cur = nodes[j]; | 56 Node cur = nodes[j]; |
57 while (cur != null) { | 57 while (cur != null) { |
58 cur = cur.lastChild; | 58 cur = cur.lastChild; |
59 } | 59 } |
60 ret = cur; | 60 ret = cur; |
61 } | 61 } |
(...skipping 12 matching lines...) Expand all Loading... |
74 for (int i = 0; i < num * 2; i++) { | 74 for (int i = 0; i < num * 2; i++) { |
75 Node cur = document.body.lastChild; | 75 Node cur = document.body.lastChild; |
76 while (cur != null) { | 76 while (cur != null) { |
77 cur = cur.previousNode; | 77 cur = cur.previousNode; |
78 } | 78 } |
79 ret = cur; | 79 ret = cur; |
80 } | 80 } |
81 }) | 81 }) |
82 .test('childNodes', () { | 82 .test('childNodes', () { |
83 for (int i = 0; i < num; i++) { | 83 for (int i = 0; i < num; i++) { |
84 final nodes = document.body.$dom_childNodes; | 84 final nodes = document.body.nodes; |
85 for (int j = 0; j < nodes.length; j++) { | 85 for (int j = 0; j < nodes.length; j++) { |
86 ret = nodes[j]; | 86 ret = nodes[j]; |
87 } | 87 } |
88 } | 88 } |
89 }) | 89 }) |
90 .end(); | 90 .end(); |
91 } | 91 } |
OLD | NEW |