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

Side by Side Diff: chrome/test/data/third_party/spaceport/js/testRunner.js

Issue 10134041: Add test data for spaceport benchmark. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
(Empty)
1 define([ 'util/ensureCallback', 'util/chainAsync' ], function (ensureCallback, c hainAsync) {
2 var testRunner = {
3 run: function run(name, test, callbacks) {
4 var stepCallback = callbacks.step || function () { };
5 var doneCallback = ensureCallback(callbacks.done);
6
7 if (typeof test === 'function') {
8 // We run the test twice (sadly): once to warm up the JIT and on ce for the actual test.
9 //test(function (_, _) {
10 test(function (err, results) {
11 stepCallback(err, name, results);
12 doneCallback(err, results);
13 });
14 //});
15 } else {
16 var allResults = { };
17
18 var subTests = Object.keys(test).map(function (subName) {
19 var newName = name ? name + '.' + subName : subName;
20 return function (next) {
21 testRunner.run(newName, test[subName], {
22 step: stepCallback,
23 done: function (err, results) {
24 if (!err) {
25 allResults[subName] = results;
26 }
27
28 next();
29 }
30 });
31 };
32 });
33
34 chainAsync(subTests.concat([
35 function () {
36 doneCallback(null, allResults);
37 }
38 ]));
39 }
40 }
41 };
42
43 return testRunner;
44 });
OLDNEW
« no previous file with comments | « chrome/test/data/third_party/spaceport/js/testDom.js ('k') | chrome/test/data/third_party/spaceport/js/tests/audioLatency.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698