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

Unified Diff: tests/lib/async/zone_debug_test.dart

Issue 2893893002: Use generic functions in zones. (Closed)
Patch Set: Fix more tests. Created 3 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
« no previous file with comments | « tests/lib/async/zone_bind_callback_unary_test.dart ('k') | tests/lib/async/zone_error_callback_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/zone_debug_test.dart
diff --git a/tests/lib/async/zone_debug_test.dart b/tests/lib/async/zone_debug_test.dart
index 7578dd2625fe9b59dd4c1d535b16aab0f57347a6..ca8535471db207bae23914ff1d6a7066259d4964 100644
--- a/tests/lib/async/zone_debug_test.dart
+++ b/tests/lib/async/zone_debug_test.dart
@@ -17,7 +17,8 @@ List restoredStackTrace = [];
List events = [];
-debugZoneRegisterCallback(Zone self, ZoneDelegate parent, Zone origin, f()) {
+ZoneCallback<R> debugZoneRegisterCallback<R>(
+ Zone self, ZoneDelegate parent, Zone origin, R f()) {
List savedTrace = [stackTrace]..addAll(restoredStackTrace);
return parent.registerCallback(origin, () {
restoredStackTrace = savedTrace;
@@ -25,8 +26,8 @@ debugZoneRegisterCallback(Zone self, ZoneDelegate parent, Zone origin, f()) {
});
}
-debugZoneRegisterUnaryCallback(
- Zone self, ZoneDelegate parent, Zone origin, f(arg)) {
+ZoneUnaryCallback<R, T> debugZoneRegisterUnaryCallback<R, T>(
+ Zone self, ZoneDelegate parent, Zone origin, R f(T arg)) {
List savedTrace = [stackTrace]..addAll(restoredStackTrace);
return parent.registerUnaryCallback(origin, (arg) {
restoredStackTrace = savedTrace;
@@ -34,13 +35,14 @@ debugZoneRegisterUnaryCallback(
});
}
-debugZoneRun(Zone self, ZoneDelegate parent, Zone origin, f()) {
+T debugZoneRun<T>(Zone self, ZoneDelegate parent, Zone origin, T f()) {
stackTrace++;
restoredStackTrace = [];
return parent.run(origin, f);
}
-debugZoneRunUnary(Zone self, ZoneDelegate parent, Zone origin, f(arg), arg) {
+R debugZoneRunUnary<R, T>(
+ Zone self, ZoneDelegate parent, Zone origin, R f(T arg), T arg) {
stackTrace++;
restoredStackTrace = [];
return parent.runUnary(origin, f, arg);
@@ -48,7 +50,7 @@ debugZoneRunUnary(Zone self, ZoneDelegate parent, Zone origin, f(arg), arg) {
List expectedDebugTrace;
-debugUncaughtHandler(
+void debugUncaughtHandler(
Zone self, ZoneDelegate parent, Zone origin, error, StackTrace stackTrace) {
events.add("handling uncaught error $error");
Expect.listEquals(expectedDebugTrace, restoredStackTrace);
@@ -116,8 +118,8 @@ main() {
expectedDebugTrace = [fork3Trace, fork2Trace, globalTrace];
throw "gee";
});
- }, runGuarded: false);
- }, runGuarded: false);
+ });
+ });
openTests++;
f();
f2();
« no previous file with comments | « tests/lib/async/zone_bind_callback_unary_test.dart ('k') | tests/lib/async/zone_error_callback_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698