Test API improvements: pumpAndSettle, autogenerate pointer IDs (#8751)

This commit is contained in:
Ian Hickson
2017-03-13 16:27:15 -07:00
committed by GitHub
parent 898b6f8549
commit 8eac6cd0da
46 changed files with 271 additions and 257 deletions

View File

@@ -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"')
);
});
});
}