test(player): anchor the passthrough absence check to the audio block
The check that keeps Audio Passthrough out of the in-player settings sheet dragged the first Scrollable ten times and then asserted the label was absent. That scrolling never moved: at the pumped 900x700 viewport the sheet fits its own content, so maxScrollExtent is 0 and the offset stays there through every drag. The assertion passed identically with no drags at all. It caught a reintroduced toggle only because the whole list happens to sit in the element tree at rest. Grow the sheet, shrink the viewport or give it a lazy delegate and findsNothing starts passing because the label is offscreen rather than gone, with nothing in the test to say so. Land on the audio block that used to hold the toggle first, then assert the absence. scrollUntilVisible throws when that block is missing entirely, so the guard fails loudly instead of quietly weakening.
This commit is contained in:
@@ -42,11 +42,13 @@ void main() {
|
|||||||
// Video Playback owns it, alongside Tunneled Playback.
|
// Video Playback owns it, alongside Tunneled Playback.
|
||||||
await _pumpSheet(tester);
|
await _pumpSheet(tester);
|
||||||
|
|
||||||
final scrollable = find.byType(Scrollable).first;
|
// Positive control: land on the audio block that used to hold the toggle. Without
|
||||||
for (var i = 0; i < 10; i++) {
|
// it, findsNothing below would also pass for an unbuilt or off-screen region, which
|
||||||
await tester.drag(scrollable, const Offset(0, -300));
|
// is what a bare scroll-then-assert silently degrades into. scrollUntilVisible
|
||||||
|
// throws when the block is missing entirely, so the guard fails loudly instead.
|
||||||
|
await tester.scrollUntilVisible(find.text('Normalize Loudness'), 300, scrollable: find.byType(Scrollable).first);
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
}
|
expect(find.text('Downmix to Stereo'), findsOneWidget);
|
||||||
|
|
||||||
expect(find.text('Audio Passthrough'), findsNothing);
|
expect(find.text('Audio Passthrough'), findsNothing);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user