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

Side by Side Diff: client/html/benchmarks/dromaeo/tests/DomModify.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 = 400; 3 final int num = 400;
4 4
5 String str = 'null'; 5 String str = 'null';
6 // Very ugly way to build up the string, but let's mimic JS version as much as possible. 6 // Very ugly way to build up the string, but let's mimic JS version as much as possible.
7 for (int i = 0; i < 1024; i++) { 7 for (int i = 0; i < 1024; i++) {
8 str += new String.fromCharCodes([((25 * Math.random()) + 97).toInt()]); 8 str += new String.fromCharCodes([((25 * Math.random()) + 97).toInt()]);
9 } 9 }
10 10
11 Array<Node> elems = new Array<Node>(); 11 Array<Node> elems = new Array<Node>();
12 12
13 // Try to force real results. 13 // Try to force real results.
14 var ret; 14 var ret;
15 window.on.load.add((Event evt) { 15 window.on.load.add((Event evt) {
16 final htmlstr = document.body.innerHTML; 16 final htmlstr = document.body.innerHTML;
17 17
18 new Suite('dom-modify') 18 new Suite('dom-modify')
19 .test('createElement', () { 19 .test('createElement', () {
20 for (int i = 0; i < num; i++) { 20 for (int i = 0; i < num; i++) {
21 ret = document.createElement('div'); 21 ret = new Element.tag('div');
22 ret = document.createElement('span'); 22 ret = new Element.tag('span');
23 ret = document.createElement('table'); 23 ret = new Element.tag('table');
24 ret = document.createElement('tr'); 24 ret = new Element.tag('tr');
25 ret = document.createElement('select'); 25 ret = new Element.tag('select');
26 } 26 }
27 }) 27 })
28 .test('createTextNode', () { 28 .test('createTextNode', () {
29 for (int i = 0; i < num; i++) { 29 for (int i = 0; i < num; i++) {
30 ret = new Text(str); 30 ret = new Text(str);
31 ret = new Text(str + '2'); 31 ret = new Text(str + '2');
32 ret = new Text(str + '3'); 32 ret = new Text(str + '3');
33 ret = new Text(str + '4'); 33 ret = new Text(str + '4');
34 ret = new Text(str + '5'); 34 ret = new Text(str + '5');
35 } 35 }
(...skipping 22 matching lines...) Expand all
58 document.body.nodes.add(elems[i]); 58 document.body.nodes.add(elems[i]);
59 }) 59 })
60 .test('insertBefore', () { 60 .test('insertBefore', () {
61 for (int i = 0; i < elems.length; i++) 61 for (int i = 0; i < elems.length; i++)
62 document.body.insertBefore(elems[i], document.body.nodes.first); 62 document.body.insertBefore(elems[i], document.body.nodes.first);
63 }) 63 })
64 .end(); 64 .end();
65 }); 65 });
66 } 66 }
67 } 67 }
OLDNEW
« no previous file with comments | « client/html/benchmarks/dromaeo/Dromaeo.dart ('k') | client/html/benchmarks/dromaeo/tests/DomQuery.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698