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

Side by Side Diff: client/html/benchmarks/dromaeo/tests/DomTraverse.dart

Issue 8835006: New version of dart:html (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix typos Created 9 years 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 class Main { 1 class Main {
2 static void main() { 2 static void main() {
3 final int num = 40; 3 final int num = 40;
4 4
5 // Try to force real results. 5 // Try to force real results.
6 var ret; 6 var ret;
7 window.on.load.add((Event evt) { 7 window.on.load.add((Event evt) {
8 String html = document.body.innerHTML; 8 String html = document.body.innerHTML;
9 9
10 new Suite('dom-traverse') 10 new Suite('dom-traverse')
11 .prep(() { 11 .prep(() {
12 html = BenchUtil.replaceAll(html, 'id="test(\\w).*?"', (Match match) { 12 html = BenchUtil.replaceAll(html, 'id="test(\\w).*?"', (Match match) {
13 final group = match.group(1); 13 final group = match.group(1);
14 return 'id="test${group}${num}"'; 14 return 'id="test${group}${num}"';
15 }); 15 });
16 html = BenchUtil.replaceAll(html, 'name="test.*?"', (Match match) { 16 html = BenchUtil.replaceAll(html, 'name="test.*?"', (Match match) {
17 return 'name="test${num}"'; 17 return 'name="test${num}"';
18 }); 18 });
19 html = BenchUtil.replaceAll(html, 'class="foo.*?"', (Match match) { 19 html = BenchUtil.replaceAll(html, 'class="foo.*?"', (Match match) {
20 return 'class="foo test${num} bar"'; 20 return 'class="foo test${num} bar"';
21 }); 21 });
22 22
23 final div = document.createElement('div'); 23 final div = new Element.tag('div');
24 div.innerHTML = html; 24 div.innerHTML = html;
25 document.body.nodes.add(div); 25 document.body.nodes.add(div);
26 }) 26 })
27 .test('firstChild', () { 27 .test('firstChild', () {
28 final nodes = document.body.nodes; 28 final nodes = document.body.nodes;
29 final nl = nodes.length; 29 final nl = nodes.length;
30 30
31 for (int i = 0; i < num; i++) { 31 for (int i = 0; i < num; i++) {
32 for (int j = 0; j < nl; j++) { 32 for (int j = 0; j < nl; j++) {
33 Node cur = nodes[j]; 33 Node cur = nodes[j];
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 final nodes = document.body.nodes; 75 final nodes = document.body.nodes;
76 for (int j = 0; j < nodes.length; j++) { 76 for (int j = 0; j < nodes.length; j++) {
77 ret = nodes[j]; 77 ret = nodes[j];
78 } 78 }
79 } 79 }
80 }) 80 })
81 .end(); 81 .end();
82 }); 82 });
83 } 83 }
84 } 84 }
OLDNEW
« no previous file with comments | « client/html/benchmarks/dromaeo/tests/DomQuery.dart ('k') | client/html/generated/src/interface/AnchorElement.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698