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

Side by Side Diff: tests/isolate/src/TestFramework.dart

Issue 8380003: Switch to new test framework. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library("TestFramework"); 5 #library("TestFramework");
6 #import("dart:coreimpl"); 6 #import("dart:coreimpl");
7 7
8 8
9 typedef void AsynchronousTestFunction(TestExpectation check); 9 typedef void AsynchronousTestFunction(TestExpectation check);
10 10
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 void failed() { 173 void failed() {
174 testCase.tearDown(); 174 testCase.tearDown();
175 } 175 }
176 176
177 Promise completes(Promise promise) { 177 Promise completes(Promise promise) {
178 Promise result = new TestPromise(this); 178 Promise result = new TestPromise(this);
179 promise.then((value) { result.complete(value); }); 179 promise.then((value) { result.complete(value); });
180 return result; 180 return result;
181 } 181 }
182 182
183 Promise completesWithValue(Promise promise, var expected) {
184 Promise result = new TestPromise(this);
185 promise.then((value) {
186 Expect.equals(expected, value);
187 result.complete(value);
188 });
189 return result;
190 }
191
183 Function runs0(Function fn) { 192 Function runs0(Function fn) {
184 bool ran = false; // We only check that the function is executed once. 193 bool ran = false; // We only check that the function is executed once.
185 pendingCallbacks++; 194 pendingCallbacks++;
186 return () { 195 return () {
187 if (!ran) pendingCallbacks--; 196 if (!ran) pendingCallbacks--;
188 ran = true; 197 ran = true;
189 return result.runGuarded(testCase, () => fn()); 198 return result.runGuarded(testCase, () => fn());
190 }; 199 };
191 } 200 }
192 201
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 283
275 void addCompleteHandler(void completeHandler(T result)) { 284 void addCompleteHandler(void completeHandler(T result)) {
276 super.addCompleteHandler(expect.runs1((T result) { 285 super.addCompleteHandler(expect.runs1((T result) {
277 completeHandler(result); 286 completeHandler(result);
278 })); 287 }));
279 } 288 }
280 289
281 final TestExpectation expect; 290 final TestExpectation expect;
282 291
283 } 292 }
OLDNEW
« no previous file with comments | « no previous file | tests/stub-generator/src/MintMakerFullyIsolatedTest.dart » ('j') | tests/stub-generator/testcfg.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698