feat: Remove triggerQuitOnInitForTest from GameScreen and add audio shutdown test
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
-24
@@ -46,30 +46,6 @@ class _CountingAudio implements EngineAudio {
|
||||
}
|
||||
|
||||
void main() {
|
||||
testWidgets('quit path shuts down audio once and exits once', (tester) async {
|
||||
final audio = _CountingAudio();
|
||||
final wolf3d = Wolf3d(audioBackend: audio);
|
||||
int appExitCallCount = 0;
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: GameScreen(
|
||||
wolf3d: wolf3d,
|
||||
skipEngineBootstrapForTest: true,
|
||||
triggerQuitOnInitForTest: true,
|
||||
appExitHandler: () async {
|
||||
appExitCallCount++;
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pump(const Duration(milliseconds: 10));
|
||||
|
||||
expect(audio.stopAllAudioCallCount, 1);
|
||||
expect(audio.disposeCallCount, 1);
|
||||
expect(appExitCallCount, 1);
|
||||
});
|
||||
|
||||
testWidgets('dispose path shuts down audio', (tester) async {
|
||||
final audio = _CountingAudio();
|
||||
final wolf3d = Wolf3d(audioBackend: audio);
|
||||
Reference in New Issue
Block a user