frosty/test/screens/settings/background_playback_setting_test.dart
Francis Lavoie daff33671e
feat(video): background audio playback when screen locked
Add an opt-in 'background playback' setting (default off) that keeps
audio playing on the native player when the app is backgrounded or the
screen locks. Drives a media3 mediaPlayback foreground service via a
setting reaction, started while the app is visible so Android 14+ grants
it while-in-use. Includes ScreenLockAudioPolicy for the audio-only
decision. Requires the matching plugin foreground-service support.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 09:54:39 -04:00

15 lines
535 B
Dart

import 'package:flutter_test/flutter_test.dart';
import 'package:frosty/screens/settings/stores/settings_store.dart';
void main() {
test('backgroundPlayback defaults to false', () {
final store = SettingsStore.fromJson({});
expect(store.backgroundPlayback, isFalse);
});
test('backgroundPlayback round-trips through json', () {
final store = SettingsStore.fromJson({})..backgroundPlayback = true;
final restored = SettingsStore.fromJson(store.toJson());
expect(restored.backgroundPlayback, isTrue);
});
}