OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:test/src/backend/group.dart'; | 7 import 'package:test/src/backend/group.dart'; |
8 import 'package:test/src/backend/state.dart'; | 8 import 'package:test/src/backend/state.dart'; |
9 import 'package:test/src/runner/engine.dart'; | 9 import 'package:test/src/runner/engine.dart'; |
10 import 'package:test/src/runner/plugin/environment.dart'; | 10 import 'package:test/src/runner/plugin/environment.dart'; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 }); | 165 }); |
166 | 166 |
167 var engine = new Engine.withSuites([ | 167 var engine = new Engine.withSuites([ |
168 new RunnerSuite(const PluginEnvironment(), new Group.root(tests)) | 168 new RunnerSuite(const PluginEnvironment(), new Group.root(tests)) |
169 ]); | 169 ]); |
170 | 170 |
171 engine.onTestStarted.listen(expectAsync((liveTest) { | 171 engine.onTestStarted.listen(expectAsync((liveTest) { |
172 expect(liveTest, same(engine.liveTests.single)); | 172 expect(liveTest, same(engine.liveTests.single)); |
173 expect(liveTest.test.name, equals(tests.single.name)); | 173 expect(liveTest.test.name, equals(tests.single.name)); |
174 | 174 |
175 var first = true; | 175 var i = 0; |
176 liveTest.onStateChange.listen(expectAsync((state) { | 176 liveTest.onStateChange.listen(expectAsync((state) { |
177 expect(state, equals(first | 177 if (i == 0) { |
178 ? const State(Status.running, Result.success) | 178 expect(state, equals(const State(Status.running, Result.success))); |
179 : const State(Status.complete, Result.success))); | 179 } else if (i == 1) { |
180 first = false; | 180 expect(state, equals(const State(Status.running, Result.skipped))); |
181 }, count: 2)); | 181 } else if (i == 2) { |
| 182 expect(state, equals(const State(Status.complete, Result.skipped))); |
| 183 } |
| 184 i++; |
| 185 }, count: 3)); |
182 | 186 |
183 expect(liveTest.onComplete, completes); | 187 expect(liveTest.onComplete, completes); |
184 })); | 188 })); |
185 | 189 |
186 return engine.run(); | 190 return engine.run(); |
187 }); | 191 }); |
188 }); | 192 }); |
189 } | 193 } |
OLD | NEW |