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

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

Issue 356573002: Revert "Move Compiler.libraries to LibraryLoder." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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
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 // Test that constants depended on by other constants are correctly deferred. 5 // Test that constants depended on by other constants are correctly deferred.
6 6
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 import "package:async_helper/async_helper.dart"; 8 import "package:async_helper/async_helper.dart";
9 import 'memory_source_file_helper.dart'; 9 import 'memory_source_file_helper.dart';
10 import "dart:async"; 10 import "dart:async";
(...skipping 19 matching lines...) Expand all
30 (name, extension) => new FakeOutputStream(), 30 (name, extension) => new FakeOutputStream(),
31 handler.diagnosticHandler, 31 handler.diagnosticHandler,
32 libraryRoot, 32 libraryRoot,
33 packageRoot, 33 packageRoot,
34 [], 34 [],
35 {}); 35 {});
36 asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) { 36 asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) {
37 var outputUnitForElement = compiler.deferredLoadTask.outputUnitForElement; 37 var outputUnitForElement = compiler.deferredLoadTask.outputUnitForElement;
38 var outputUnitForConstant = compiler.deferredLoadTask.outputUnitForConstant; 38 var outputUnitForConstant = compiler.deferredLoadTask.outputUnitForConstant;
39 var mainOutputUnit = compiler.deferredLoadTask.mainOutputUnit; 39 var mainOutputUnit = compiler.deferredLoadTask.mainOutputUnit;
40 var lib = 40 var lib = compiler.libraries["memory:lib.dart"];
41 compiler.libraryLoader.lookupLibrary(Uri.parse("memory:lib.dart"));
42 var backend = compiler.backend; 41 var backend = compiler.backend;
43 List<Constant> allConstants = []; 42 List<Constant> allConstants = [];
44 43
45 addConstantWithDependendencies(Constant c) { 44 addConstantWithDependendencies(Constant c) {
46 allConstants.add(c); 45 allConstants.add(c);
47 c.getDependencies().forEach(addConstantWithDependendencies); 46 c.getDependencies().forEach(addConstantWithDependendencies);
48 } 47 }
49 48
50 backend.constants.compiledConstants.forEach(addConstantWithDependendencies); 49 backend.constants.compiledConstants.forEach(addConstantWithDependendencies);
51 for (String stringValue in ["cA", "cB", "cC"]) { 50 for (String stringValue in ["cA", "cB", "cC"]) {
(...skipping 24 matching lines...) Expand all
76 print(lib.L); 75 print(lib.L);
77 } 76 }
78 """, "lib.dart": """ 77 """, "lib.dart": """
79 class C { 78 class C {
80 final a; 79 final a;
81 const C(this.a); 80 const C(this.a);
82 } 81 }
83 82
84 const L = const {"cA": const C(const {"cB": "cC"})}; 83 const L = const {"cA": const C(const {"cB": "cC"})};
85 """,}; 84 """,};
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698