Chromium Code Reviews| 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 library analyzer.test.src.task.dart_test; | 5 library analyzer.test.src.task.dart_test; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/ast/token.dart'; | 8 import 'package:analyzer/dart/ast/token.dart'; |
| 9 import 'package:analyzer/dart/ast/visitor.dart'; | 9 import 'package:analyzer/dart/ast/visitor.dart'; |
| 10 import 'package:analyzer/dart/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
| (...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1069 TypeProvider typeProvider = outputs[TYPE_PROVIDER]; | 1069 TypeProvider typeProvider = outputs[TYPE_PROVIDER]; |
| 1070 expect(typeProvider, isNotNull); | 1070 expect(typeProvider, isNotNull); |
| 1071 expect(typeProvider.boolType, isNotNull); | 1071 expect(typeProvider.boolType, isNotNull); |
| 1072 expect(typeProvider.intType, isNotNull); | 1072 expect(typeProvider.intType, isNotNull); |
| 1073 expect(typeProvider.futureType, isNotNull); | 1073 expect(typeProvider.futureType, isNotNull); |
| 1074 } | 1074 } |
| 1075 } | 1075 } |
| 1076 | 1076 |
| 1077 @reflectiveTest | 1077 @reflectiveTest |
| 1078 class BuildTypeProviderTaskTest_noAsync extends _AbstractDartTaskTest { | 1078 class BuildTypeProviderTaskTest_noAsync extends _AbstractDartTaskTest { |
| 1079 DartSdk createDartSdk() => new MockSdk(dartAsync: false); | |
|
Brian Wilkerson
2016/03/28 16:58:03
Should this be a constant?
| |
| 1080 | |
| 1079 void prepareAnalysisContext([AnalysisOptions options]) { | 1081 void prepareAnalysisContext([AnalysisOptions options]) { |
| 1080 AnalysisOptionsImpl newOptions = new AnalysisOptionsImpl(); | 1082 AnalysisOptionsImpl newOptions = new AnalysisOptionsImpl(); |
| 1081 newOptions.enableAsync = false; | 1083 newOptions.enableAsync = false; |
| 1082 super.prepareAnalysisContext(newOptions); | 1084 super.prepareAnalysisContext(newOptions); |
| 1083 } | 1085 } |
| 1084 | 1086 |
| 1085 void setUp() { | |
| 1086 sdk = new MockSdk(dartAsync: false); | |
| 1087 super.setUp(); | |
| 1088 } | |
| 1089 | |
| 1090 test_perform_noAsync() { | 1087 test_perform_noAsync() { |
| 1091 expect(context, isNotNull); | 1088 expect(context, isNotNull); |
| 1092 computeResult(AnalysisContextTarget.request, TYPE_PROVIDER, | 1089 computeResult(AnalysisContextTarget.request, TYPE_PROVIDER, |
| 1093 matcher: isBuildTypeProviderTask); | 1090 matcher: isBuildTypeProviderTask); |
| 1094 // validate | 1091 // validate |
| 1095 TypeProvider typeProvider = outputs[TYPE_PROVIDER]; | 1092 TypeProvider typeProvider = outputs[TYPE_PROVIDER]; |
| 1096 expect(typeProvider, isNotNull); | 1093 expect(typeProvider, isNotNull); |
| 1097 expect(typeProvider.boolType, isNotNull); | 1094 expect(typeProvider.boolType, isNotNull); |
| 1098 expect(typeProvider.intType, isNotNull); | 1095 expect(typeProvider.intType, isNotNull); |
| 1099 expect(typeProvider.futureType, isNotNull); | 1096 expect(typeProvider.futureType, isNotNull); |
| (...skipping 3939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5039 /** | 5036 /** |
| 5040 * Fill [errorListener] with [result] errors in the current [task]. | 5037 * Fill [errorListener] with [result] errors in the current [task]. |
| 5041 */ | 5038 */ |
| 5042 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { | 5039 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { |
| 5043 List<AnalysisError> errors = task.outputs[result]; | 5040 List<AnalysisError> errors = task.outputs[result]; |
| 5044 expect(errors, isNotNull, reason: result.name); | 5041 expect(errors, isNotNull, reason: result.name); |
| 5045 errorListener = new GatheringErrorListener(); | 5042 errorListener = new GatheringErrorListener(); |
| 5046 errorListener.addAll(errors); | 5043 errorListener.addAll(errors); |
| 5047 } | 5044 } |
| 5048 } | 5045 } |
| OLD | NEW |