utopia-ia/elffuss-code public
Changesets · Branches · Tags · Compare
| Changeset | 17d8624c4d4f7404f60b845f68f078d8234f3d78519c51e45735d2fe33db48fa |
|---|---|
| Author | KikoCis <kikocisneros@gmail.com> · 2026-10-13 12:40 +02:00 |
| Committer | KikoCis <kikocisneros@gmail.com> · 2026-10-13 12:40 +02:00 |
| Parents | 405a38187cae |
3 files changed
modified tests/messages-ux.mjs +8 −1
| @@ -28,7 +28,14 @@ | ||
| 28 | 28 | const errs = []; |
| 29 | 29 | const abre = async (locale, query = '') => { |
| 30 | 30 | const ctx = await b.newContext({ locale }); |
| 31 | - await ctx.addInitScript(() => { try { localStorage.setItem('elffusscode.model', 'rules'); } catch {} window.__alerts = 0; window.alert = () => { window.__alerts++; }; }); | |
| 31 | + // WebGPU simulada y pequeña: desde d526a74 la tarjeta del ONNX ligero solo sale | |
| 32 | + // con WebGPU, y el navegador de pruebas tiene navigator.gpu sin adaptador. | |
| 33 | + await ctx.addInitScript(() => { | |
| 34 | + try { localStorage.setItem('elffusscode.model', 'rules'); } catch {} | |
| 35 | + window.__alerts = 0; window.alert = () => { window.__alerts++; }; | |
| 36 | + const falsa = { requestAdapter: async () => ({ limits: { maxBufferSize: 2 ** 28 }, features: new Set(), info: {}, requestDevice: async () => { throw new Error('no hace falta'); } }) }; | |
| 37 | + try { Object.defineProperty(Navigator.prototype, 'gpu', { get() { return falsa; }, configurable: true }); } catch { /* */ } | |
| 38 | + }); | |
| 32 | 39 | await ctx.route('**/js/providers/onnx.js*', r => r.fulfill({ status: 200, contentType: 'text/javascript', body: FALLA })); |
| 33 | 40 | await ctx.route(/api\.github\.com|raw\.githubusercontent\.com/, r => r.abort()); |
| 34 | 41 | await ctx.route(/soundcloud/, r => r.abort()); |
modified tests/notif-run.mjs +5 −1
| @@ -31,7 +31,11 @@ | ||
| 31 | 31 | async function abre({ modelo, sembrar = true, id = 'abc123def' }) { |
| 32 | 32 | const ctx = await b.newContext({ locale: 'es-ES' }); |
| 33 | 33 | await ctx.addInitScript(m => { |
| 34 | - try { Object.defineProperty(Navigator.prototype, 'gpu', { get() { return undefined; }, configurable: true }); } catch { /* */ } | |
| 34 | + // WebGPU simulada y pequeña (no entra Gemma): desde d526a74 el ONNX ligero | |
| 35 | + // solo se ofrece con WebGPU, y este test va del flujo de la notificación, | |
| 36 | + // no de la GPU. transformers.js es de mentira: no se baja nada. | |
| 37 | + const falsa = { requestAdapter: async () => ({ limits: { maxBufferSize: 2 ** 28 }, features: new Set(), info: {}, requestDevice: async () => { throw new Error('no hace falta'); } }) }; | |
| 38 | + try { Object.defineProperty(Navigator.prototype, 'gpu', { get() { return falsa; }, configurable: true }); } catch { /* */ } | |
| 35 | 39 | try { localStorage.setItem('elffusscode.model', m); } catch { /* */ } |
| 36 | 40 | }, modelo); |
| 37 | 41 | const p = await ctx.newPage({ viewport: { width: 1400, height: 900 } }); |
modified tests/settings-ux.mjs +4 −0
| @@ -33,6 +33,10 @@ | ||
| 33 | 33 | try { localStorage.setItem('elffusscode.model', 'rules'); localStorage.setItem('elffusscode.bridgeToken', 'tok-de-prueba'); } catch {} |
| 34 | 34 | const datos = arch === null ? undefined : { getHighEntropyValues: async () => ({ architecture: arch }) }; |
| 35 | 35 | Object.defineProperty(Navigator.prototype, 'userAgentData', { get: () => datos, configurable: true }); |
| 36 | + // WebGPU simulada y pequeña: desde d526a74 la tarjeta del ONNX ligero solo | |
| 37 | + // sale con WebGPU, y el navegador de pruebas tiene navigator.gpu sin adaptador. | |
| 38 | + const falsa = { requestAdapter: async () => ({ limits: { maxBufferSize: 2 ** 28 }, features: new Set(), info: {}, requestDevice: async () => { throw new Error('no hace falta'); } }) }; | |
| 39 | + try { Object.defineProperty(Navigator.prototype, 'gpu', { get() { return falsa; }, configurable: true }); } catch { /* */ } | |
| 36 | 40 | }, arch); |
| 37 | 41 | const p = await ctx.newPage({ viewport: { width: 1400, height: 900 } }); |
| 38 | 42 | p.on('pageerror', e => errs.push(e.message.slice(0, 160))); |