| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // TODO(gram): | 5 // TODO(gram): |
| 6 // Unfortunately I can't seem to test anything that involves timeouts, e.g. | 6 // Unfortunately I can't seem to test anything that involves timeouts, e.g. |
| 7 // insufficient callbacks, because the timeout is controlled externally | 7 // insufficient callbacks, because the timeout is controlled externally |
| 8 // (test.dart?), and we would need to use a shorter timeout for the inner tests | 8 // (test.dart?), and we would need to use a shorter timeout for the inner tests |
| 9 // so the outer timeout doesn't fire. So I removed all such tests. | 9 // so the outer timeout doesn't fire. So I removed all such tests. |
| 10 // I'd like to revisit this at some point. | 10 // I'd like to revisit this at some point. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 } | 73 } |
| 74 | 74 |
| 75 class MockList extends Mock implements List { | 75 class MockList extends Mock implements List { |
| 76 } | 76 } |
| 77 | 77 |
| 78 class Foo { | 78 class Foo { |
| 79 sum(a, b, c) => a + b + c; | 79 sum(a, b, c) => a + b + c; |
| 80 } | 80 } |
| 81 | 81 |
| 82 class FooSpy extends Mock implements Foo { | 82 class FooSpy extends Mock implements Foo { |
| 83 FooSpy real; | 83 Foo real; |
| 84 FooSpy() { | 84 FooSpy() { |
| 85 real = new Foo(); | 85 real = new Foo(); |
| 86 this.when(callsTo('sum')).alwaysCall(real.sum); | 86 this.when(callsTo('sum')).alwaysCall(real.sum); |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 | 89 |
| 90 runTest() { | 90 runTest() { |
| 91 port.receive((testName, sendport) { | 91 port.receive((testName, sendport) { |
| 92 configure(_testconfig = new TestConfiguration(sendport)); | 92 configure(_testconfig = new TestConfiguration(sendport)); |
| 93 if (testName == 'single correct test') { | 93 if (testName == 'single correct test') { |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 message: 'Caught Exception: No behavior specified for method foo'), | 271 message: 'Caught Exception: No behavior specified for method foo'), |
| 272 buildStatusString(0, 1, 0, tests[15], | 272 buildStatusString(0, 1, 0, tests[15], |
| 273 message: 'Expected sum() to sometimes return <0> but: never did') | 273 message: 'Expected sum() to sometimes return <0> but: never did') |
| 274 ]; | 274 ]; |
| 275 | 275 |
| 276 actual = []; | 276 actual = []; |
| 277 | 277 |
| 278 nextTest(0); | 278 nextTest(0); |
| 279 } | 279 } |
| 280 | 280 |
| OLD | NEW |