OLD | NEW |
1 #library("dom_modify_html"); | 1 #library("dom_modify_html"); |
2 #import("dart:html"); | 2 #import("dart:html"); |
3 #import("dart:json"); | 3 #import("dart:json"); |
| 4 #import("dart:math", prefix: "Math"); |
4 #source("Common.dart"); | 5 #source("Common.dart"); |
5 #source("RunnerSuite.dart"); | 6 #source("RunnerSuite.dart"); |
6 | 7 |
7 void main() { | 8 void main() { |
8 final int num = 400; | 9 final int num = 400; |
9 | 10 |
10 String str = 'null'; | 11 String str = 'null'; |
11 // Very ugly way to build up the string, but let's mimic JS version as much as
possible. | 12 // Very ugly way to build up the string, but let's mimic JS version as much as
possible. |
12 for (int i = 0; i < 1024; i++) { | 13 for (int i = 0; i < 1024; i++) { |
13 str = "$str${new String.fromCharCodes([((25 * Math.random()) + 97).toInt()])
}"; | 14 str = "$str${new String.fromCharCodes([((25 * Math.random()) + 97).toInt()])
}"; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 .test('appendChild', () { | 60 .test('appendChild', () { |
60 for (int i = 0; i < elems.length; i++) | 61 for (int i = 0; i < elems.length; i++) |
61 document.body.$dom_appendChild(elems[i]); | 62 document.body.$dom_appendChild(elems[i]); |
62 }) | 63 }) |
63 .test('insertBefore', () { | 64 .test('insertBefore', () { |
64 for (int i = 0; i < elems.length; i++) | 65 for (int i = 0; i < elems.length; i++) |
65 document.body.insertBefore(elems[i], document.body.$dom_firstChild); | 66 document.body.insertBefore(elems[i], document.body.$dom_firstChild); |
66 }) | 67 }) |
67 .end(); | 68 .end(); |
68 } | 69 } |
OLD | NEW |