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

Side by Side Diff: pkg/unittest/test/utils.dart

Issue 416133002: Abort unit tests in the event of async failure while awaiting a future. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update pubspec and changelog Created 6 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 | « pkg/unittest/test/async_exception_with_future_test.dart ('k') | 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 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of unittestTest; 5 part of unittestTest;
6 6
7 /**
8 * Schedule [fn] for future execution in an event handler.
9 */
7 Future _defer(void fn()) { 10 Future _defer(void fn()) {
8 return new Future.sync(fn); 11 return new Future(fn);
9 } 12 }
10 13
11 String buildStatusString(int passed, int failed, int errors, 14 String buildStatusString(int passed, int failed, int errors,
12 var results, 15 var results,
13 {int count: 0, 16 {int count: 0,
14 String setup: '', String teardown: '', 17 String setup: '', String teardown: '',
15 String uncaughtError: null, 18 String uncaughtError: null,
16 String message: ''}) { 19 String message: ''}) {
17 var totalTests = 0; 20 var totalTests = 0;
18 var testDetails = new StringBuffer(); 21 var testDetails = new StringBuffer();
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 testFunction(testConfig); 87 testFunction(testConfig);
85 } 88 }
86 89
87 void main() { 90 void main() {
88 var replyPort = new ReceivePort(); 91 var replyPort = new ReceivePort();
89 Isolate.spawn(runTestInIsolate, replyPort.sendPort); 92 Isolate.spawn(runTestInIsolate, replyPort.sendPort);
90 replyPort.first.then((String msg) { 93 replyPort.first.then((String msg) {
91 expect(msg.trim(), expected); 94 expect(msg.trim(), expected);
92 }); 95 });
93 } 96 }
OLDNEW
« no previous file with comments | « pkg/unittest/test/async_exception_with_future_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698