Chromium Code Reviews| Index: tests/compiler/dart2js/library_load_test.dart |
| diff --git a/tests/compiler/dart2js/library_load_test.dart b/tests/compiler/dart2js/library_load_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8ca6656a4db0ed12a5eb4460afe02861a568bd9e |
| --- /dev/null |
| +++ b/tests/compiler/dart2js/library_load_test.dart |
| @@ -0,0 +1,33 @@ |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +import "package:expect/expect.dart"; |
| +import 'mock_compiler.dart'; |
| + |
| +class ScanMockCompiler extends MockCompiler { |
| + ScanMockCompiler() { |
|
ahe
2013/08/19 08:48:53
Weird indentation.
zarah
2013/08/28 10:20:13
Done.
|
| + isolateHelperLibrary = null; |
|
ahe
2013/08/19 08:48:53
Ditto.
zarah
2013/08/28 10:20:13
Done.
|
| + foreignLibrary = null; |
| + } |
| + LibraryElement scanBuiltinLibrary(String filename) { |
|
ahe
2013/08/19 08:48:53
Add empty line before this method.
zarah
2013/08/28 10:20:13
Done.
|
| + return createLibrary(filename, "main(){}"); |
| + } |
| +} |
| + |
| +void main() { |
| + Compiler compiler = new ScanMockCompiler(); |
| + Expect.equals(null, compiler.isolateHelperLibrary); |
| + Expect.equals(null, compiler.foreignLibrary); |
| + compiler.onLibraryLoaded(mockLibrary(compiler, "mock"), |
| + new Uri(scheme: 'dart', path: '_isolate_helper')); |
| + Expect.isTrue(compiler.isolateHelperLibrary != null); |
| + compiler.onLibraryLoaded(mockLibrary(compiler, "mock"), |
| + new Uri(scheme: 'dart', path: '_foreign_helper')); |
| + Expect.isTrue(compiler.isolateHelperLibrary != null); |
| + Expect.equals(new Uri(scheme: 'dart', path: '_isolate_helper'), |
| + compiler.isolateHelperLibrary.canonicalUri); |
| + Expect.isTrue(compiler.foreignLibrary != null); |
| + Expect.equals(new Uri(scheme: 'dart', path: '_foreign_helper'), |
| + compiler.foreignLibrary.canonicalUri); |
| +} |