Unverified Commit 7b86be22 authored by Konstantin Scheglov's avatar Konstantin Scheglov Committed by GitHub

Use runZonedGuarded() instead of deprecated onError. (#69160)

parent 55289324
......@@ -305,7 +305,7 @@ void main() {
final FlutterError error = FlutterError('Oops');
double errorCount = 0;
runZoned(
runZonedGuarded(
() async {
mockHelper.refreshCompleter = Completer<void>.sync();
await tester.pumpWidget(
......@@ -371,7 +371,7 @@ void main() {
)));
expect(mockHelper.invocations, hasLength(5));
},
onError: (dynamic e) {
(Object e, StackTrace stack) {
expect(e, error);
expect(errorCount, 0);
errorCount++;
......
......@@ -152,7 +152,7 @@ void main() {
final Completer<void> completer = Completer<void>();
await FakeAsync().run((FakeAsync time) {
unawaited(runZoned(() async {
unawaited(runZonedGuarded(() async {
final Future<void> f = asyncGuard<void>(() => delayedThrow(time))
.catchError((Object e, StackTrace s) {
caughtByCatchError = true;
......@@ -165,7 +165,7 @@ void main() {
if (!completer.isCompleted) {
completer.complete(null);
}
}, onError: (Object e, StackTrace s) {
}, (Object e, StackTrace s) {
caughtByZone = true;
if (!completer.isCompleted) {
completer.complete(null);
......@@ -188,7 +188,7 @@ void main() {
final Completer<void> completer = Completer<void>();
await FakeAsync().run((FakeAsync time) {
unawaited(runZoned(() async {
unawaited(runZonedGuarded(() async {
final Future<void> f = asyncGuard<void>(
() => delayedThrow(time),
onError: (Object e, StackTrace s) {
......@@ -203,7 +203,7 @@ void main() {
if (!completer.isCompleted) {
completer.complete(null);
}
}, onError: (Object e, StackTrace s) {
}, (Object e, StackTrace s) {
caughtByZone = true;
if (!completer.isCompleted) {
completer.complete(null);
......@@ -226,7 +226,7 @@ void main() {
final Completer<void> completer = Completer<void>();
await FakeAsync().run((FakeAsync time) {
unawaited(runZoned(() async {
unawaited(runZonedGuarded(() async {
final Future<void> f = asyncGuard<void>(
() => delayedThrow(time),
onError: (Object e) {
......@@ -241,7 +241,7 @@ void main() {
if (!completer.isCompleted) {
completer.complete(null);
}
}, onError: (Object e, StackTrace s) {
}, (Object e, StackTrace s) {
caughtByZone = true;
if (!completer.isCompleted) {
completer.complete(null);
......@@ -265,7 +265,7 @@ void main() {
final Completer<void> completer = Completer<void>();
await FakeAsync().run((FakeAsync time) {
unawaited(runZoned(() async {
unawaited(runZonedGuarded(() async {
final Future<void> f = asyncGuard<void>(
() => delayedThrow(time),
onError: (Object e, [StackTrace s]) {
......@@ -281,7 +281,7 @@ void main() {
if (!completer.isCompleted) {
completer.complete(null);
}
}, onError: (Object e, StackTrace s) {
}, (Object e, StackTrace s) {
caughtByZone = true;
if (!completer.isCompleted) {
completer.complete(null);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment