| OLD | NEW |
| 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 Future _defer(void fn()) { | 7 Future _defer(void fn()) { |
| 8 return new Future.sync(fn); | 8 return new Future.sync(fn); |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 int count = 0; // A count of callbacks. | 39 int count = 0; // A count of callbacks. |
| 40 String setup = ''; // The name of the test group setup function, if any. | 40 String setup = ''; // The name of the test group setup function, if any. |
| 41 String teardown = ''; // The name of the group teardown function, if any. | 41 String teardown = ''; // The name of the group teardown function, if any. |
| 42 | 42 |
| 43 // The port to communicate with the parent isolate | 43 // The port to communicate with the parent isolate |
| 44 final SendPort _port; | 44 final SendPort _port; |
| 45 String _result; | 45 String _result; |
| 46 | 46 |
| 47 TestConfiguration(this._port); | 47 TestConfiguration(this._port); |
| 48 | 48 |
| 49 void onInit() {} |
| 50 |
| 49 void onSummary(int passed, int failed, int errors, List<TestCase> results, | 51 void onSummary(int passed, int failed, int errors, List<TestCase> results, |
| 50 String uncaughtError) { | 52 String uncaughtError) { |
| 51 _result = buildStatusString(passed, failed, errors, results, | 53 _result = buildStatusString(passed, failed, errors, results, |
| 52 count: count, setup: setup, teardown: teardown, | 54 count: count, setup: setup, teardown: teardown, |
| 53 uncaughtError: uncaughtError); | 55 uncaughtError: uncaughtError); |
| 54 } | 56 } |
| 55 | 57 |
| 56 void onDone(bool success) { | 58 void onDone(bool success) { |
| 57 _port.send(_result); | 59 _port.send(_result); |
| 58 } | 60 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 86 }); | 88 }); |
| 87 } | 89 } |
| 88 | 90 |
| 89 main() { | 91 main() { |
| 90 spawnFunction(runTestInIsolate) | 92 spawnFunction(runTestInIsolate) |
| 91 .call('') | 93 .call('') |
| 92 .then((String msg) { | 94 .then((String msg) { |
| 93 expect(msg.trim(), equals(expected)); | 95 expect(msg.trim(), equals(expected)); |
| 94 }); | 96 }); |
| 95 } | 97 } |
| OLD | NEW |