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 'dart:uri'; | |
8 import 'parser_helper.dart'; | 7 import 'parser_helper.dart'; |
9 import 'mock_compiler.dart'; | 8 import 'mock_compiler.dart'; |
10 import '../../../sdk/lib/_internal/compiler/compiler.dart'; | 9 import '../../../sdk/lib/_internal/compiler/compiler.dart'; |
11 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' as l
eg; | 10 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' as l
eg; |
12 import '../../../sdk/lib/_internal/compiler/implementation/dart_backend/dart_bac
kend.dart'; | 11 import '../../../sdk/lib/_internal/compiler/implementation/dart_backend/dart_bac
kend.dart'; |
13 import '../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t'; | 12 import '../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t'; |
14 import '../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart'; | 13 import '../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart'; |
15 | 14 |
16 const coreLib = r''' | 15 const coreLib = r''' |
17 library corelib; | 16 library corelib; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 stripTypes: stripTypes); | 80 stripTypes: stripTypes); |
82 } | 81 } |
83 | 82 |
84 /** | 83 /** |
85 * Library name is assumed to be 'mylib' in 'mylib.dart' file. | 84 * Library name is assumed to be 'mylib' in 'mylib.dart' file. |
86 */ | 85 */ |
87 testDart2DartWithLibrary( | 86 testDart2DartWithLibrary( |
88 String srcMain, String srcLibrary, | 87 String srcMain, String srcLibrary, |
89 {void continuation(String s), bool minify: false, | 88 {void continuation(String s), bool minify: false, |
90 bool stripTypes: false}) { | 89 bool stripTypes: false}) { |
91 fileUri(path) => new Uri.fromComponents(scheme: 'file', path: path); | 90 fileUri(path) => new Uri(scheme: 'file', path: path); |
92 | 91 |
93 final scriptUri = fileUri('script.dart'); | 92 final scriptUri = fileUri('script.dart'); |
94 final libUri = fileUri('mylib.dart'); | 93 final libUri = fileUri('mylib.dart'); |
95 | 94 |
96 provider(uri) { | 95 provider(uri) { |
97 if (uri == scriptUri) return new Future.value(srcMain); | 96 if (uri == scriptUri) return new Future.value(srcMain); |
98 if (uri.toString() == libUri.toString()) { | 97 if (uri.toString() == libUri.toString()) { |
99 return new Future.value(srcLibrary); | 98 return new Future.value(srcLibrary); |
100 } | 99 } |
101 if (uri.path.endsWith('/core.dart')) { | 100 if (uri.path.endsWith('/core.dart')) { |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 testStaticAccessIoLib(); | 722 testStaticAccessIoLib(); |
724 testLocalFunctionPlaceholder(); | 723 testLocalFunctionPlaceholder(); |
725 testMinification(); | 724 testMinification(); |
726 testClosureLocalsMinified(); | 725 testClosureLocalsMinified(); |
727 testParametersMinified(); | 726 testParametersMinified(); |
728 testDeclarationTypePlaceholders(); | 727 testDeclarationTypePlaceholders(); |
729 testPlatformLibraryMemberNamesAreFixed(); | 728 testPlatformLibraryMemberNamesAreFixed(); |
730 testConflictsWithCoreLib(); | 729 testConflictsWithCoreLib(); |
731 testUnresolvedNamedConstructor(); | 730 testUnresolvedNamedConstructor(); |
732 } | 731 } |
OLD | NEW |