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

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

Issue 17759007: First pass at asynchronous input loading in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 7 years, 3 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
« no previous file with comments | « tests/compiler/dart2js/dead_code_test.dart ('k') | tests/compiler/dart2js/diagnose_ambiguous_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
diff --git a/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart b/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
index b6b10651dd2c9949097e7141bd79640cf4cc4dbd..31ff16da7f8b423f2f69fd495084ea134138d4ad 100644
--- a/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
+++ b/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
@@ -7,6 +7,7 @@
// much be included in the initial download (loaded eagerly).
import 'package:expect/expect.dart';
+import "package:async_helper/async_helper.dart";
import 'memory_source_file_helper.dart';
import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart'
@@ -17,8 +18,7 @@ void main() {
Uri libraryRoot = script.resolve('../../../sdk/');
Uri packageRoot = script.resolve('./packages/');
- MemorySourceFileProvider.MEMORY_SOURCE_FILES = MEMORY_SOURCE_FILES;
- var provider = new MemorySourceFileProvider();
+ var provider = new MemorySourceFileProvider(MEMORY_SOURCE_FILES);
var handler = new FormattingDiagnosticHandler(provider);
Compiler compiler = new Compiler(provider.readStringFromUri,
@@ -27,26 +27,27 @@ void main() {
libraryRoot,
packageRoot,
['--analyze-only']);
- compiler.run(Uri.parse('memory:main.dart'));
- var main = compiler.mainApp.find(dart2js.Compiler.MAIN);
- Expect.isNotNull(main, 'Could not find "main"');
- compiler.deferredLoadTask.onResolutionComplete(main);
+ asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) {
+ var main = compiler.mainApp.find(dart2js.Compiler.MAIN);
+ Expect.isNotNull(main, 'Could not find "main"');
+ compiler.deferredLoadTask.onResolutionComplete(main);
- var deferredClasses =
- compiler.deferredLoadTask.allDeferredElements.where((e) => e.isClass())
- .toSet();
+ var deferredClasses =
+ compiler.deferredLoadTask.allDeferredElements.where((e) => e.isClass())
+ .toSet();
- var dateTime =
- deferredClasses
- .where((e) => e.name.slowToString() == 'DateTime').single;
+ var dateTime =
+ deferredClasses
+ .where((e) => e.name.slowToString() == 'DateTime').single;
- var myClass =
- deferredClasses.where((e) => e.name.slowToString() == 'MyClass').single;
+ var myClass =
+ deferredClasses.where((e) => e.name.slowToString() == 'MyClass').single;
- var deferredLibrary = compiler.libraries['memory:deferred.dart'];
+ var deferredLibrary = compiler.libraries['memory:deferred.dart'];
- Expect.equals(deferredLibrary, myClass.getLibrary());
- Expect.equals(compiler.coreLibrary, dateTime.declaration.getLibrary());
+ Expect.equals(deferredLibrary, myClass.getLibrary());
+ Expect.equals(compiler.coreLibrary, dateTime.declaration.getLibrary());
+ }));
}
const Map MEMORY_SOURCE_FILES = const {
« no previous file with comments | « tests/compiler/dart2js/dead_code_test.dart ('k') | tests/compiler/dart2js/diagnose_ambiguous_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698