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

Unified Diff: dart/tests/compiler/dart2js_extra/deferred/deferred_function_test.dart

Issue 23523003: Address a number of issues related to computation of currentScript and deferred loading. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add tests 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 side-by-side diff with in-line comments
Download patch
Index: dart/tests/compiler/dart2js_extra/deferred/deferred_function_test.dart
diff --git a/dart/tests/compiler/dart2js_extra/deferred/deferred_function_test.dart b/dart/tests/compiler/dart2js_extra/deferred/deferred_function_test.dart
index 3f15bec66fd78706001659e85ae821c85e497657..896e027fef49eb4f03086e1ba61f537d8511bb3e 100644
--- a/dart/tests/compiler/dart2js_extra/deferred/deferred_function_test.dart
+++ b/dart/tests/compiler/dart2js_extra/deferred/deferred_function_test.dart
@@ -5,8 +5,12 @@
// Test that loading of a library (with top-level functions only) can
// be deferred.
-import "package:expect/expect.dart";
+import '../../../async_helper.dart';
+
+import 'package:expect/expect.dart';
+
import 'dart:async';
+
@lazy import 'deferred_function_library.dart';
const lazy = const DeferredLibrary('deferred_function_library');
@@ -21,26 +25,27 @@ readFoo() {
}
main() {
- print('unittest-suite-wait-for-done');
-
Expect.throws(() { foo('a'); }, isNoSuchMethodError);
Expect.isNull(readFoo());
int counter = 0;
+ asyncStart();
lazy.load().then((bool didLoad) {
Expect.isTrue(didLoad);
Expect.equals(1, ++counter);
print('lazy was loaded');
Expect.equals(42, foo('b'));
Expect.isNotNull(readFoo());
+ asyncEnd();
});
Expect.equals(0, counter);
+ asyncStart();
lazy.load().then((bool didLoad) {
Expect.isFalse(didLoad);
Expect.equals(2, ++counter);
print('lazy was loaded');
Expect.equals(42, foo('b'));
Expect.isNotNull(readFoo());
- print('unittest-suite-success');
+ asyncEnd();
});
Expect.equals(0, counter);
Expect.throws(() { foo('a'); }, isNoSuchMethodError);

Powered by Google App Engine
This is Rietveld 408576698