OLD | NEW |
| (Empty) |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
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. | |
4 | |
5 import "package:expect/expect.dart"; | |
6 import 'mock_compiler.dart'; | |
7 | |
8 class ScanMockCompiler extends MockCompiler { | |
9 ScanMockCompiler() { | |
10 isolateHelperLibrary = null; | |
11 foreignLibrary = null; | |
12 } | |
13 | |
14 LibraryElement scanBuiltinLibrary(String filename) { | |
15 return createLibrary(filename, "main(){}"); | |
16 } | |
17 } | |
18 | |
19 void main() { | |
20 Compiler compiler = new ScanMockCompiler(); | |
21 Expect.equals(null, compiler.isolateHelperLibrary); | |
22 Expect.equals(null, compiler.foreignLibrary); | |
23 compiler.onLibraryLoaded(mockLibrary(compiler, "mock"), | |
24 new Uri(scheme: 'dart', path: '_isolate_helper')); | |
25 Expect.isTrue(compiler.isolateHelperLibrary != null); | |
26 compiler.onLibraryLoaded(mockLibrary(compiler, "mock"), | |
27 new Uri(scheme: 'dart', path: '_foreign_helper')); | |
28 Expect.isTrue(compiler.isolateHelperLibrary != null); | |
29 Expect.equals(new Uri(scheme: 'dart', path: '_isolate_helper'), | |
30 compiler.isolateHelperLibrary.canonicalUri); | |
31 Expect.isTrue(compiler.foreignLibrary != null); | |
32 Expect.equals(new Uri(scheme: 'dart', path: '_foreign_helper'), | |
33 compiler.foreignLibrary.canonicalUri); | |
34 } | |
OLD | NEW |