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 "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 import 'dart:async'; | 6 import 'dart:async'; |
| 7 import "package:async_helper/async_helper.dart"; |
7 import 'parser_helper.dart'; | 8 import 'parser_helper.dart'; |
8 import 'mock_compiler.dart'; | 9 import 'mock_compiler.dart'; |
9 import '../../../sdk/lib/_internal/compiler/compiler.dart'; | 10 import '../../../sdk/lib/_internal/compiler/compiler.dart'; |
10 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' as l
eg; | 11 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' as l
eg; |
11 import '../../../sdk/lib/_internal/compiler/implementation/dart_backend/dart_bac
kend.dart'; | 12 import '../../../sdk/lib/_internal/compiler/implementation/dart_backend/dart_bac
kend.dart'; |
12 import '../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t'; | 13 import '../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t'; |
13 import '../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart'; | 14 import '../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart'; |
14 | 15 |
15 const coreLib = r''' | 16 const coreLib = r''' |
16 library corelib; | 17 library corelib; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 Expect.fail('$uri: $begin-$end: $message [$kind]'); | 123 Expect.fail('$uri: $begin-$end: $message [$kind]'); |
123 } | 124 } |
124 } | 125 } |
125 | 126 |
126 final options = <String>['--output-type=dart']; | 127 final options = <String>['--output-type=dart']; |
127 // Some tests below are using dart:io. | 128 // Some tests below are using dart:io. |
128 options.add('--categories=Client,Server'); | 129 options.add('--categories=Client,Server'); |
129 if (minify) options.add('--minify'); | 130 if (minify) options.add('--minify'); |
130 if (stripTypes) options.add('--force-strip=types'); | 131 if (stripTypes) options.add('--force-strip=types'); |
131 | 132 |
132 compile( | 133 asyncTest(() => compile( |
133 scriptUri, | 134 scriptUri, |
134 fileUri('libraryRoot/'), | 135 fileUri('libraryRoot/'), |
135 fileUri('packageRoot/'), | 136 fileUri('packageRoot/'), |
136 provider, | 137 provider, |
137 handler, | 138 handler, |
138 options).then(continuation); | 139 options).then(continuation)); |
139 } | 140 } |
140 | 141 |
141 testSimpleFileUnparse() { | 142 testSimpleFileUnparse() { |
142 final src = ''' | 143 final src = ''' |
143 should_be_dropped() { | 144 should_be_dropped() { |
144 } | 145 } |
145 | 146 |
146 should_be_kept() { | 147 should_be_kept() { |
147 } | 148 } |
148 | 149 |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 testStaticAccessIoLib(); | 727 testStaticAccessIoLib(); |
727 testLocalFunctionPlaceholder(); | 728 testLocalFunctionPlaceholder(); |
728 testMinification(); | 729 testMinification(); |
729 testClosureLocalsMinified(); | 730 testClosureLocalsMinified(); |
730 testParametersMinified(); | 731 testParametersMinified(); |
731 testDeclarationTypePlaceholders(); | 732 testDeclarationTypePlaceholders(); |
732 testPlatformLibraryMemberNamesAreFixed(); | 733 testPlatformLibraryMemberNamesAreFixed(); |
733 testConflictsWithCoreLib(); | 734 testConflictsWithCoreLib(); |
734 testUnresolvedNamedConstructor(); | 735 testUnresolvedNamedConstructor(); |
735 } | 736 } |
OLD | NEW |