Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: tests/compiler/dart2js/library_load_test.dart

Issue 23258002: Load builtin helper libraries on demand. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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() {
ahe 2013/08/19 08:48:53 Weird indentation.
zarah 2013/08/28 10:20:13 Done.
10 isolateHelperLibrary = null;
ahe 2013/08/19 08:48:53 Ditto.
zarah 2013/08/28 10:20:13 Done.
11 foreignLibrary = null;
12 }
13 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.
14 return createLibrary(filename, "main(){}");
15 }
16 }
17
18 void main() {
19 Compiler compiler = new ScanMockCompiler();
20 Expect.equals(null, compiler.isolateHelperLibrary);
21 Expect.equals(null, compiler.foreignLibrary);
22 compiler.onLibraryLoaded(mockLibrary(compiler, "mock"),
23 new Uri(scheme: 'dart', path: '_isolate_helper'));
24 Expect.isTrue(compiler.isolateHelperLibrary != null);
25 compiler.onLibraryLoaded(mockLibrary(compiler, "mock"),
26 new Uri(scheme: 'dart', path: '_foreign_helper'));
27 Expect.isTrue(compiler.isolateHelperLibrary != null);
28 Expect.equals(new Uri(scheme: 'dart', path: '_isolate_helper'),
29 compiler.isolateHelperLibrary.canonicalUri);
30 Expect.isTrue(compiler.foreignLibrary != null);
31 Expect.equals(new Uri(scheme: 'dart', path: '_foreign_helper'),
32 compiler.foreignLibrary.canonicalUri);
33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698