Call each with what cinny sends (badge, unread, call state, thumbbar, SMTC, taskbar progress, jump list, update-ready, flash), then reset; every call must succeed and the app must still respond. Refs #4, #7, #19 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8fe5d29be3
commit
31363e601c
@@ -312,6 +312,60 @@ try {
|
|||||||
record('global hotkeys reach the page', /not found/i.test(msg) ? 'n/a' : 'fail', msg);
|
record('global hotkeys reach the page', /not found/i.test(msg) ? 'n/a' : 'fail', msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 10. Tray / badge / taskbar / thumbbar / media-controls commands (#4, #7):
|
||||||
|
// the state they set is only visible to a person on a desktop, but each must
|
||||||
|
// accept what cinny sends and leave the app working. Then reset everything.
|
||||||
|
const calls = [
|
||||||
|
['set_badge_count', { count: 3 }],
|
||||||
|
['set_tray_unread', { unread: true }],
|
||||||
|
['set_call_active', { active: true }],
|
||||||
|
['set_tray_call_state', { active: true, muted: true, deafened: false }],
|
||||||
|
['set_thumbbar', { active: true, muted: true, deafened: false }],
|
||||||
|
['set_thumbbar', { active: true, muted: false, deafened: true }],
|
||||||
|
['set_smtc_call_state', { active: true, muted: true }],
|
||||||
|
['set_taskbar_progress', { status: 'normal', progress: 40 }],
|
||||||
|
['set_taskbar_progress', { status: 'indeterminate', progress: null }],
|
||||||
|
['set_jump_list', { items: [{ title: 'Smoke room', uri: 'matrix:r/lotus-smoke:example.org' }] }],
|
||||||
|
['set_tray_update_ready', { version: '9.9.9' }],
|
||||||
|
['flash_window', {}],
|
||||||
|
['get_tray_dnd', {}],
|
||||||
|
['has_tray_host', {}],
|
||||||
|
// reset
|
||||||
|
['set_badge_count', { count: 0 }],
|
||||||
|
['set_tray_unread', { unread: false }],
|
||||||
|
['set_tray_call_state', { active: false, muted: false, deafened: false }],
|
||||||
|
['set_thumbbar', { active: false, muted: false, deafened: false }],
|
||||||
|
['set_smtc_call_state', { active: false, muted: false }],
|
||||||
|
['set_call_active', { active: false }],
|
||||||
|
['set_taskbar_progress', { status: 'none', progress: null }],
|
||||||
|
['set_jump_list', { items: [] }],
|
||||||
|
['set_tray_update_ready', { version: null }],
|
||||||
|
];
|
||||||
|
const failures = [];
|
||||||
|
for (const [cmd, args] of calls) {
|
||||||
|
// eslint-disable-next-line no-await-in-loop
|
||||||
|
const err = await page
|
||||||
|
.evaluate(
|
||||||
|
async ([c, a]) => {
|
||||||
|
try {
|
||||||
|
await window.__TAURI_INTERNALS__.invoke(c, a);
|
||||||
|
return null;
|
||||||
|
} catch (e) {
|
||||||
|
return String(e).slice(0, 120);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[cmd, args],
|
||||||
|
)
|
||||||
|
.catch((e) => `page gone: ${String(e).slice(0, 80)}`);
|
||||||
|
if (err) failures.push(`${cmd}(${JSON.stringify(args)}): ${err}`);
|
||||||
|
}
|
||||||
|
const alive = await page.evaluate(() => document.title !== undefined).catch(() => false);
|
||||||
|
record(
|
||||||
|
'tray, badge, taskbar, thumbbar and media-control commands',
|
||||||
|
failures.length === 0 && alive ? 'pass' : 'fail',
|
||||||
|
failures.length ? failures.join(' | ') : `${calls.length} calls ok, app still responsive: ${alive}`,
|
||||||
|
);
|
||||||
|
|
||||||
await page.screenshot({ path: `${OUT}/02-end.png` }).catch(() => undefined);
|
await page.screenshot({ path: `${OUT}/02-end.png` }).catch(() => undefined);
|
||||||
|
|
||||||
writeFileSync(`${OUT}/results.json`, JSON.stringify(results, null, 2));
|
writeFileSync(`${OUT}/results.json`, JSON.stringify(results, null, 2));
|
||||||
|
|||||||
Reference in New Issue
Block a user