| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'package:expect/expect.dart'; | 6 import 'package:expect/expect.dart'; |
| 7 import 'package:async_helper/async_helper.dart'; | 7 import 'package:async_helper/async_helper.dart'; |
| 8 import 'package:compiler/src/compiler.dart'; | 8 import 'package:compiler/src/compiler.dart'; |
| 9 import 'package:compiler/src/diagnostics/messages.dart' show | 9 import 'package:compiler/src/diagnostics/messages.dart' show |
| 10 MessageKind; | 10 MessageKind; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 if (expectIsPatched) { | 199 if (expectIsPatched) { |
| 200 AstElement patch = | 200 AstElement patch = |
| 201 ensure(compiler, "test", compiler.coreLibrary.patch.find, | 201 ensure(compiler, "test", compiler.coreLibrary.patch.find, |
| 202 expectIsPatch: true, checkHasBody: true); | 202 expectIsPatch: true, checkHasBody: true); |
| 203 Expect.equals(origin.patch, patch); | 203 Expect.equals(origin.patch, patch); |
| 204 Expect.equals(patch.origin, origin); | 204 Expect.equals(patch.origin, origin); |
| 205 Expect.equals(patchText, patch.node.toString()); | 205 Expect.equals(patchText, patch.node.toString()); |
| 206 } | 206 } |
| 207 | 207 |
| 208 compiler.analyzeElement(origin); | 208 compiler.analyzeElement(origin); |
| 209 compiler.enqueuer.resolution.emptyDeferredTaskQueue(); | 209 compiler.enqueuer.resolution.emptyDeferredQueueForTesting(); |
| 210 | 210 |
| 211 DiagnosticCollector collector = compiler.diagnosticCollector; | 211 DiagnosticCollector collector = compiler.diagnosticCollector; |
| 212 Expect.isTrue(collector.warnings.isEmpty, | 212 Expect.isTrue(collector.warnings.isEmpty, |
| 213 "Unexpected warnings: ${collector.warnings}"); | 213 "Unexpected warnings: ${collector.warnings}"); |
| 214 if (expectedError != null) { | 214 if (expectedError != null) { |
| 215 Expect.equals(expectedError, | 215 Expect.equals(expectedError, |
| 216 collector.errors.first.message.toString()); | 216 collector.errors.first.message.toString()); |
| 217 } else { | 217 } else { |
| 218 Expect.isTrue(collector.errors.isEmpty, | 218 Expect.isTrue(collector.errors.isEmpty, |
| 219 "Unexpected errors: ${collector.errors}"); | 219 "Unexpected errors: ${collector.errors}"); |
| (...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 await testPatchNonFunction(); | 1110 await testPatchNonFunction(); |
| 1111 | 1111 |
| 1112 await testPatchAndSelector(); | 1112 await testPatchAndSelector(); |
| 1113 | 1113 |
| 1114 await testEffectiveTarget(); | 1114 await testEffectiveTarget(); |
| 1115 | 1115 |
| 1116 await testAnalyzeAllInjectedMembers(); | 1116 await testAnalyzeAllInjectedMembers(); |
| 1117 await testTypecheckPatchedMembers(); | 1117 await testTypecheckPatchedMembers(); |
| 1118 }); | 1118 }); |
| 1119 } | 1119 } |
| OLD | NEW |