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

Side by Side Diff: tests/html/utils.dart

Issue 12159005: Dartifying some IndexedDB APIs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 library TestUtils; 1 library TestUtils;
2 import 'dart:async';
2 import '../../pkg/unittest/lib/unittest.dart'; 3 import '../../pkg/unittest/lib/unittest.dart';
3 4
4 /** 5 /**
5 * Verifies that [actual] has the same graph structure as [expected]. 6 * Verifies that [actual] has the same graph structure as [expected].
6 * Detects cycles and DAG structure in Maps and Lists. 7 * Detects cycles and DAG structure in Maps and Lists.
7 */ 8 */
8 verifyGraph(expected, actual) { 9 verifyGraph(expected, actual) {
9 var eItems = []; 10 var eItems = [];
10 var aItems = []; 11 var aItems = [];
11 12
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 62 }
62 } 63 }
63 return; 64 return;
64 } 65 }
65 66
66 expect(false, isTrue, reason: 'Unhandled type: $expected'); 67 expect(false, isTrue, reason: 'Unhandled type: $expected');
67 } 68 }
68 69
69 walk('', expected, actual); 70 walk('', expected, actual);
70 } 71 }
72
73 void futureTest(spec, Future body()) {
74 test(spec, () {
75 expect(body(), completes);
76 });
77 }
78
79 /**
80 * Executes an array of test functions which return futures in parallel.
81 *
82 * This returns a future result of the last function.
83 */
84 Future chainSteps(List<Function> steps) {
85 var future = steps[0](null);
86 for (var step in steps.skip(1)) {
87 future = future.then(step);
88 }
89 return future;
90 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698