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

Unified Diff: tests/compiler/dart2js/mock_compiler.dart

Issue 2760923004: Eliminate multi-callback structure for LibraryLoader. (Closed)
Patch Set: . Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/mock_compiler.dart
diff --git a/tests/compiler/dart2js/mock_compiler.dart b/tests/compiler/dart2js/mock_compiler.dart
index 602a69451852f13c165eb4c66d079752d52c71e4..c80a3cb95eae6cbf7f0ae5900381793446767d8c 100644
--- a/tests/compiler/dart2js/mock_compiler.dart
+++ b/tests/compiler/dart2js/mock_compiler.dart
@@ -17,6 +17,7 @@ import 'package:compiler/src/diagnostics/source_span.dart';
import 'package:compiler/src/diagnostics/spannable.dart';
import 'package:compiler/src/elements/elements.dart';
import 'package:compiler/src/elements/visitor.dart';
+import 'package:compiler/src/library_loader.dart' show LoadedLibraries;
import 'package:compiler/src/js_backend/backend_helpers.dart'
show BackendHelpers;
import 'package:compiler/src/js_backend/lookup_map_analysis.dart'
@@ -143,8 +144,11 @@ class MockCompiler extends Compiler {
Future<Uri> init([String mainSource = ""]) {
Uri uri = new Uri(scheme: "mock");
registerSource(uri, mainSource);
- return libraryLoader.loadLibrary(uri).then((LibraryElement library) {
- mainApp = library;
+ return libraryLoader
+ .loadLibrary(uri)
+ .then((LoadedLibraries loadedLibraries) {
+ processLoadedLibraries(loadedLibraries);
+ mainApp = loadedLibraries.rootLibrary;
startResolution();
// We need to make sure the Object class is resolved. When registering a
// dynamic invocation the ArgumentTypesRegistry eventually iterates over

Powered by Google App Engine
This is Rietveld 408576698