Use runZonedGuarded() instead of deprecated onError. (#69160)
This commit is contained in:
parent
55289324c6
commit
7b86be228e
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user