Test API improvements: pumpAndSettle, autogenerate pointer IDs (#8751)
This commit is contained in:
@@ -77,11 +77,11 @@ void main() {
|
||||
duration: const Duration(milliseconds: 5100),
|
||||
vsync: tester,
|
||||
);
|
||||
count = await tester.pumpUntilNoTransientCallbacks(const Duration(seconds: 1));
|
||||
expect(count, 0);
|
||||
count = await tester.pumpAndSettle(const Duration(seconds: 1));
|
||||
expect(count, 1); // it always pumps at least one frame
|
||||
|
||||
test.forward(from: 0.0);
|
||||
count = await tester.pumpUntilNoTransientCallbacks(const Duration(seconds: 1));
|
||||
count = await tester.pumpAndSettle(const Duration(seconds: 1));
|
||||
// 1 frame at t=0, starting the animation
|
||||
// 1 frame at t=1
|
||||
// 1 frame at t=2
|
||||
@@ -93,13 +93,13 @@ void main() {
|
||||
|
||||
test.forward(from: 0.0);
|
||||
await tester.pump(); // starts the animation
|
||||
count = await tester.pumpUntilNoTransientCallbacks(const Duration(seconds: 1));
|
||||
count = await tester.pumpAndSettle(const Duration(seconds: 1));
|
||||
expect(count, 6);
|
||||
|
||||
test.forward(from: 0.0);
|
||||
await tester.pump(); // starts the animation
|
||||
await tester.pump(); // has no effect
|
||||
count = await tester.pumpUntilNoTransientCallbacks(const Duration(seconds: 1));
|
||||
count = await tester.pumpAndSettle(const Duration(seconds: 1));
|
||||
expect(count, 6);
|
||||
});
|
||||
});
|
||||
@@ -180,9 +180,9 @@ void main() {
|
||||
|
||||
expect(failure, isNotNull);
|
||||
expect(
|
||||
failure.message,
|
||||
contains('Actual: ?:<zero widgets with text "bar" that has ancestor(s) with type Column with text "foo"')
|
||||
);
|
||||
failure.message,
|
||||
contains('Actual: ?:<zero widgets with text "bar" that has ancestor(s) with type Column with text "foo"')
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user