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

Side by Side Diff: samples/third_party/dromaeo/tests/dom-modify-html.dart

Issue 10873014: Fix up Dromaeo tests for the removal of the Math.random call. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #import("dart:math", prefix: "Math");
5 #source("Common.dart"); 5 #source("Common.dart");
6 #source("RunnerSuite.dart"); 6 #source("RunnerSuite.dart");
7 7
8 void main() { 8 void main() {
9 final int num = 400; 9 final int num = 400;
10 var random = new Math.Random();
10 11
11 String str = 'null'; 12 String str = 'null';
12 // Very ugly way to build up the string, but let's mimic JS version as much as possible. 13 // Very ugly way to build up the string, but let's mimic JS version as much as possible.
13 for (int i = 0; i < 1024; i++) { 14 for (int i = 0; i < 1024; i++) {
14 str = "$str${new String.fromCharCodes([((25 * Math.random()) + 97).toInt()]) }"; 15 str = "$str${new String.fromCharCodes([((25 * random.nextDouble()) + 97).toI nt()])}";
15 } 16 }
16 17
17 List<Node> elems = <Node>[]; 18 List<Node> elems = <Node>[];
18 19
19 // Try to force real results. 20 // Try to force real results.
20 var ret; 21 var ret;
21 22
22 final htmlstr = document.body.innerHTML; 23 final htmlstr = document.body.innerHTML;
23 24
24 new Suite(window, 'dom-modify') 25 new Suite(window, 'dom-modify')
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 .test('appendChild', () { 61 .test('appendChild', () {
61 for (int i = 0; i < elems.length; i++) 62 for (int i = 0; i < elems.length; i++)
62 document.body.$dom_appendChild(elems[i]); 63 document.body.$dom_appendChild(elems[i]);
63 }) 64 })
64 .test('insertBefore', () { 65 .test('insertBefore', () {
65 for (int i = 0; i < elems.length; i++) 66 for (int i = 0; i < elems.length; i++)
66 document.body.insertBefore(elems[i], document.body.$dom_firstChild); 67 document.body.insertBefore(elems[i], document.body.$dom_firstChild);
67 }) 68 })
68 .end(); 69 .end();
69 } 70 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698