Fixed for decoder dl speed and mobile warnings on low memory devices.

This commit is contained in:
Lucas Winther committed 2026-07-29 07:47:42 +02:00
1 parent 2643a446d0
commit 78e99fc415
7 files changed
+208 -32

No files matched your search

+14
View File
@@ -70,6 +70,20 @@ describe("shouldWarnBeforeLoad", () => {
).toBe(false);
});
// D-029: deviceMemoryGB 2-4 is the ordinary (not just budget) Android
// range today — these must still warn for Medium+, the exact class of
// phone the original D-027 crash report was about.
test("warns on mobile mid-range devices (deviceMemory 2-4) for Medium+", () => {
for (const deviceMemoryGB of [2, 4]) {
expect(
shouldWarnBeforeLoad(
{ userAgent: ANDROID_UA, maxTouchPoints: 5, deviceMemoryGB },
MEDIUM_PEAK_BYTES,
),
).toBe(true);
}
});
test("falls back to a flat threshold when deviceMemory is unreported (iOS)", () => {
expect(
shouldWarnBeforeLoad(