OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 analyzer.test.cancelable_future_test; | 5 library analyzer.test.cancelable_future_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analyzer/src/cancelable_future.dart'; | 9 import 'package:analyzer/src/cancelable_future.dart'; |
10 import 'package:test/test.dart'; | 10 import 'package:test/test.dart'; |
11 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 11 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
12 import 'package:watcher/src/utils.dart'; | 12 import 'package:watcher/src/utils.dart'; |
13 | 13 |
14 import 'utils.dart'; | |
15 | |
16 void main() { | 14 void main() { |
17 initializeTestEnvironment(); | |
18 defineReflectiveSuite(() { | 15 defineReflectiveSuite(() { |
19 defineReflectiveTests(CancelableCompleterTests); | 16 defineReflectiveTests(CancelableCompleterTests); |
20 defineReflectiveTests(CancelableFutureTests); | 17 defineReflectiveTests(CancelableFutureTests); |
21 }); | 18 }); |
22 } | 19 } |
23 | 20 |
24 @reflectiveTest | 21 @reflectiveTest |
25 class CancelableCompleterTests { | 22 class CancelableCompleterTests { |
26 CancelableCompleter<Object> completer; | 23 CancelableCompleter<Object> completer; |
27 int cancelCount = 0; | 24 int cancelCount = 0; |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 | 419 |
423 Future test_value() { | 420 Future test_value() { |
424 Object obj = new Object(); | 421 Object obj = new Object(); |
425 return new CancelableFuture.value(obj).then((result) { | 422 return new CancelableFuture.value(obj).then((result) { |
426 expect(result, same(obj)); | 423 expect(result, same(obj)); |
427 }, onError: (error) { | 424 }, onError: (error) { |
428 fail('Expected successful completion'); | 425 fail('Expected successful completion'); |
429 }); | 426 }); |
430 } | 427 } |
431 } | 428 } |
OLD | NEW |