- Introduced a new Flutter project for the cxyz Android manga/comic reader, including essential files such as pubspec.yaml, AndroidManifest.xml, and Gradle configuration. - Added .gitignore files to exclude unnecessary files and directories for both the main project and Android-specific files. - Implemented initial README.md with project description, features, setup instructions, and API details for ComicLand, MangaRead, and MangaTown. - Configured analysis options and dependencies in pubspec.yaml to support Flutter development. - Established a pnpm workspace and lockfile for dependency management. - Included various Android resources such as icons, styles, and launch backgrounds for a complete application setup.
35 lines
864 B
Dart
35 lines
864 B
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
/// Mirrors DownloadQueue session drain gating used in `_pump`.
|
|
bool shouldNotifyQueueDrained({
|
|
required bool sessionHadWork,
|
|
required int queuedRemaining,
|
|
}) {
|
|
return sessionHadWork && queuedRemaining == 0;
|
|
}
|
|
|
|
void main() {
|
|
group('queue drained gating', () {
|
|
test('does not fire when no work was processed', () {
|
|
expect(
|
|
shouldNotifyQueueDrained(sessionHadWork: false, queuedRemaining: 0),
|
|
isFalse,
|
|
);
|
|
});
|
|
|
|
test('fires when work ran and queue is empty', () {
|
|
expect(
|
|
shouldNotifyQueueDrained(sessionHadWork: true, queuedRemaining: 0),
|
|
isTrue,
|
|
);
|
|
});
|
|
|
|
test('does not fire while items remain', () {
|
|
expect(
|
|
shouldNotifyQueueDrained(sessionHadWork: true, queuedRemaining: 2),
|
|
isFalse,
|
|
);
|
|
});
|
|
});
|
|
}
|