perf(tabs): release stale image and tab state
Pixel 10 APK / build (push) Successful in 37m12s

This commit is contained in:
Codex
2026-08-10 17:59:50 +02:00
parent 03227320f4
commit aab2bc0cee
10 changed files with 203 additions and 8 deletions
@@ -0,0 +1,34 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:riverpod/riverpod.dart';
import 'package:weblibre/features/geckoview/domain/providers/tab_detail_state.dart';
void main() {
test('closed tab progress is pruned without touching active tabs', () {
final container = ProviderContainer();
addTearDown(container.dispose);
final notifier = container.read(tabProgressStatesProvider.notifier);
notifier.update('closed-tab', 80);
notifier.update('active-tab', 40);
notifier.removeAll({'closed-tab', 'unknown-tab'});
expect(container.read(tabProgressStatesProvider), {'active-tab': 40});
});
test('pruning unrelated ids does not publish a new map', () {
final container = ProviderContainer();
addTearDown(container.dispose);
final notifier = container.read(tabProgressStatesProvider.notifier);
notifier.update('active-tab', 40);
final before = container.read(tabProgressStatesProvider);
notifier.removeAll({'unknown-tab'});
expect(
identical(container.read(tabProgressStatesProvider), before),
isTrue,
);
});
}