OLD | NEW |
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 /// Check that relative URIs are resolved against the canonical name of a | 5 /// Check that relative URIs are resolved against the canonical name of a |
6 /// library. This only matters for dart:-libraries, so this test mocks up two | 6 /// library. This only matters for dart:-libraries, so this test mocks up two |
7 /// dart:-libraries. | 7 /// dart:-libraries. |
8 | 8 |
9 import "dart:io"; | 9 import "dart:io"; |
10 | 10 |
11 import "dart:async"; | 11 import "dart:async"; |
12 | 12 |
13 import "memory_source_file_helper.dart"; | 13 import "memory_source_file_helper.dart"; |
14 | 14 |
15 import "package:async_helper/async_helper.dart"; | 15 import "package:async_helper/async_helper.dart"; |
16 | 16 |
17 import 'package:expect/expect.dart' show Expect; | 17 import 'package:expect/expect.dart' show Expect; |
18 | 18 |
19 import 'package:compiler/src/diagnostics/messages.dart' | 19 import 'package:compiler/src/diagnostics/messages.dart' |
20 show MessageKind, MessageTemplate; | 20 show MessageKind, MessageTemplate; |
21 | 21 |
22 import 'package:compiler/src/elements/elements.dart' show LibraryElement; | 22 import 'package:compiler/src/elements/elements.dart' show LibraryElement; |
23 | 23 |
24 import 'package:compiler/src/null_compiler_output.dart' show NullCompilerOutput; | 24 import 'package:compiler/src/null_compiler_output.dart' show NullCompilerOutput; |
25 | 25 |
26 import 'package:compiler/src/old_to_new_api.dart' | 26 import 'package:compiler/src/old_to_new_api.dart' |
27 show LegacyCompilerDiagnostics, LegacyCompilerInput; | 27 show LegacyCompilerDiagnostics, LegacyCompilerInput; |
28 import 'package:compiler/compiler_new.dart' show CompilerOptions; | 28 import 'package:compiler/src/options.dart' show CompilerOptions; |
29 | 29 |
30 Uri sdkRoot = Uri.base.resolve("sdk/"); | 30 Uri sdkRoot = Uri.base.resolve("sdk/"); |
31 Uri mock1LibraryUri = sdkRoot.resolve("lib/mock1.dart"); | 31 Uri mock1LibraryUri = sdkRoot.resolve("lib/mock1.dart"); |
32 Uri mock2LibraryUri = sdkRoot.resolve("lib/mock2.dart"); | 32 Uri mock2LibraryUri = sdkRoot.resolve("lib/mock2.dart"); |
33 | 33 |
34 class CustomCompiler extends CompilerImpl { | 34 class CustomCompiler extends CompilerImpl { |
35 CustomCompiler(provider, handler, libraryRoot, packageRoot) | 35 CustomCompiler(provider, handler, libraryRoot, packageRoot) |
36 : super(provider, const NullCompilerOutput(), handler, | 36 : super(provider, const NullCompilerOutput(), handler, |
37 new CompilerOptions( | 37 new CompilerOptions( |
38 libraryRoot: libraryRoot, | 38 libraryRoot: libraryRoot, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 var library = | 90 var library = |
91 await compiler.libraryLoader.loadLibrary(Uri.parse("dart:m_o_c_k_1")); | 91 await compiler.libraryLoader.loadLibrary(Uri.parse("dart:m_o_c_k_1")); |
92 await checkLibrary(library); | 92 await checkLibrary(library); |
93 asyncSuccess(null); | 93 asyncSuccess(null); |
94 } | 94 } |
95 | 95 |
96 const Map MEMORY_SOURCE_FILES = const { | 96 const Map MEMORY_SOURCE_FILES = const { |
97 "mock1.dart": "library mock1; import 'mock2.dart';", | 97 "mock1.dart": "library mock1; import 'mock2.dart';", |
98 "mock2.dart": "library mock2;", | 98 "mock2.dart": "library mock2;", |
99 }; | 99 }; |
OLD | NEW |