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

Side by Side Diff: samples/third_party/dromaeo/htmlrunner.js

Issue 178223008: Replace run_selenium.py with Dart script that uses the browser controller for performance tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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
OLDNEW
1 // An version of Dromaeo's original htmlrunner adapted for the 1 // An version of Dromaeo's original htmlrunner adapted for the
2 // Dart-based test driver. 2 // Dart-based test driver.
3 3
4 var _operations = []; 4 var _operations = [];
5 var _N_RUNS = 5; 5 var _N_RUNS = 5;
6 var _nRanTests = 0; 6 var _nRanTests = 0;
7 var _nTests = 0; 7 var _nTests = 0;
8 var _T_DISTRIBUTION = 2.776; 8 var _T_DISTRIBUTION = 2.776;
9 9
10 function startTest() { 10 function startTest() {
(...skipping 21 matching lines...) Expand all
32 } 32 }
33 } 33 }
34 window.setTimeout(handler, 0); 34 window.setTimeout(handler, 0);
35 } 35 }
36 36
37 function _postMessage(command, data) { 37 function _postMessage(command, data) {
38 var payload = { 'command': command }; 38 var payload = { 'command': command };
39 if (data) { 39 if (data) {
40 payload['data'] = data; 40 payload['data'] = data;
41 } 41 }
42 window.top.postMessage(JSON.stringify(payload), '*'); 42 window.parent.postMessage(JSON.stringify(payload), '*');
43 } 43 }
44 44
45 function test(name, fn) { 45 function test(name, fn) {
46 _nTests++; 46 _nTests++;
47 _operations.push(function () { 47 _operations.push(function () {
48 // List of number of runs in seconds. 48 // List of number of runs in seconds.
49 var runsPerSecond = []; 49 var runsPerSecond = [];
50 // Run the test several times. 50 // Run the test several times.
51 try { 51 try {
52 // TODO(antonm): use .setTimeout to schedule next run as JS 52 // TODO(antonm): use .setTimeout to schedule next run as JS
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 }); 133 });
134 } 134 }
135 135
136 function endTest() { 136 function endTest() {
137 _postMessage('inited', { 'nTests': _nTests }); 137 _postMessage('inited', { 'nTests': _nTests });
138 } 138 }
139 139
140 function prep(fn) { 140 function prep(fn) {
141 _operations.push(fn); 141 _operations.push(fn);
142 } 142 }
OLDNEW
« no previous file with comments | « samples/third_party/dromaeo/generate_perf_and_dart2js_tests.py ('k') | samples/third_party/dromaeo/tests/RunnerSuite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698