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

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

Issue 8330003: Rename cloneNode to clone and move it into the Node interface. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Don't change the benchmark that uses the DOM interface. Created 9 years, 2 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
« no previous file with comments | « no previous file | client/html/release/html.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
(...skipping 26 matching lines...) Expand all
37 .test('innerHTML', () { 37 .test('innerHTML', () {
38 document.body.innerHTML = htmlstr; 38 document.body.innerHTML = htmlstr;
39 }) 39 })
40 .prep(() { 40 .prep(() {
41 elems = new Array<Node>(); 41 elems = new Array<Node>();
42 final telems = document.body.nodes; 42 final telems = document.body.nodes;
43 for (int i = 0; i < telems.length; i++) { 43 for (int i = 0; i < telems.length; i++) {
44 elems.add(telems[i]); 44 elems.add(telems[i]);
45 } 45 }
46 }) 46 })
47 .test('cloneNode', () { 47 .test('clone', () {
48 for (int i = 0; i < elems.length; i++) { 48 for (int i = 0; i < elems.length; i++) {
49 // not supported by Dart... this will intentionally throw an excepti on. 49 // not supported by Dart... this will intentionally throw an excepti on.
50 // TODO(jacobr): find the right solution. 50 // TODO(jacobr): find the right solution.
51 ret = elems[i].dynamic.cloneNode(false); 51 ret = elems[i].dynamic.clone(false);
52 ret = elems[i].dynamic.cloneNode(true); 52 ret = elems[i].dynamic.clone(true);
53 ret = elems[i].dynamic.cloneNode(true); 53 ret = elems[i].dynamic.clone(true);
54 } 54 }
55 }) 55 })
56 .test('appendChild', () { 56 .test('appendChild', () {
57 for (int i = 0; i < elems.length; i++) 57 for (int i = 0; i < elems.length; i++)
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 | « no previous file | client/html/release/html.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698