/* ── the card is still in the shade ─────────────────────── What a small icon the shade cannot inflate, or a large icon that throws while the notification is built, actually does: the card is never posted at all. So read it back out of the same dump the downloads notice uses — our package, on the `playback` channel, with the playing track's own title on it. The title is taken from the player on BOTH sides of the dump because a track may cross while it runs, and either answer is a correct one; both sides come from the live app at the same moment, so a real core answering faster than the mock cannot make this disagree with itself. It runs after `resumed` has asserted status === "playing", so the ongoing card is settled state rather than a race, and it sits above `media-keys`, which proves the transport still answers through the session. What this canNOT prove: the GLYPH. `dumpsys notification` prints the icon's resource id and never a pixel, so a correct falcon and a white rectangle read identically here. That one is a screenshot. */ let cardBefore = await cdp.evaluate(PLAYER); let cardNote = shadeNotice(); let cardAfter = await cdp.evaluate(PLAYER); const cardAgrees = () => /playback/.test(cardNote.shadeChans) && !!cardNote.shadeCard && (cardNote.shadeCard === cardBefore?.title || cardNote.shadeCard === cardAfter?.title); if (!cardAgrees()) { /* the one race the two reads do not cover: `push()` in media.svelte.js is debounced, so the card trails the player by a moment, and a track crossing exactly here shows the player two NEW titles and the shade the old one. Let it settle and look once more. A card that is not posted at all fails this the second time too. */ await sleep(2000); cardBefore = await cdp.evaluate(PLAYER); cardNote = shadeNotice(); cardAfter = await cdp.evaluate(PLAYER); } const cardOk = cardAgrees(); const cardSeen = { chans: cardNote.shadeChans, card: cardNote.shadeCard, title: cardAfter?.title ?? null }; if (!cardOk) problems.push("EXPECT media-card " + JSON.stringify(cardSeen)); console.log((cardOk ? " ok " : " FAIL ") + "media-card".padEnd(16) + " " + JSON.stringify(cardSeen));