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

Side by Side Diff: pkg/analyzer/test/cancelable_future_test.dart

Issue 2298913003: Pull in test_reflective_loader 0.0.4 and switch analyzer to it. (Closed)
Patch Set: Fixes for review comments. Created 4 years, 3 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
OLDNEW
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_reflective_loader/test_reflective_loader.dart';
10 import 'package:unittest/unittest.dart'; 11 import 'package:unittest/unittest.dart';
11 import 'package:watcher/src/utils.dart'; 12 import 'package:watcher/src/utils.dart';
12 13
13 import 'reflective_tests.dart';
14 import 'utils.dart'; 14 import 'utils.dart';
15 15
16 void main() { 16 void main() {
17 initializeTestEnvironment(); 17 initializeTestEnvironment();
18 runReflectiveTests(CancelableCompleterTests); 18 defineReflectiveTests(CancelableCompleterTests);
19 runReflectiveTests(CancelableFutureTests); 19 defineReflectiveTests(CancelableFutureTests);
20 } 20 }
21 21
22 @reflectiveTest 22 @reflectiveTest
23 class CancelableCompleterTests { 23 class CancelableCompleterTests {
24 CancelableCompleter<Object> completer; 24 CancelableCompleter<Object> completer;
25 int cancelCount = 0; 25 int cancelCount = 0;
26 26
27 void setUp() { 27 void setUp() {
28 completer = new CancelableCompleter<Object>(() { 28 completer = new CancelableCompleter<Object>(() {
29 cancelCount++; 29 cancelCount++;
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 420
421 Future test_value() { 421 Future test_value() {
422 Object obj = new Object(); 422 Object obj = new Object();
423 return new CancelableFuture.value(obj).then((result) { 423 return new CancelableFuture.value(obj).then((result) {
424 expect(result, same(obj)); 424 expect(result, same(obj));
425 }, onError: (error) { 425 }, onError: (error) {
426 fail('Expected successful completion'); 426 fail('Expected successful completion');
427 }); 427 });
428 } 428 }
429 } 429 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698