aboutsummaryrefslogtreecommitdiffstats
path: root/tools/feed-media-views-test.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-22 10:28:22 -0700
committerAdam Soltys <[email protected]>2026-10-22 10:28:22 -0700
commitd59a7f0c9b32002ff23f74a2996b986cf1f0dd05 (patch)
treefacd2a6a200c183ccc0d9b9cc4e1320b0b1207de /tools/feed-media-views-test.js
parentcc84dd0c6c852b46b309079a5a90a54080fc049c (diff)
downloadcoinosv3-d59a7f0c9b32002ff23f74a2996b986cf1f0dd05.tar.gz
coinosv3-d59a7f0c9b32002ff23f74a2996b986cf1f0dd05.zip
Videos: a desktop-sized window defaults to every shape (a phone keeps to its way round; the choice is stored only when it differs from the device's default). A clip's shape falls back to its still's proportions, so leaving All shapes finds the clips known. The grid's pager keeps a clip of unknown shape out until measured, as the grid does (d898efb let an unmeasured landscape clip into a phone's vertical pager).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'tools/feed-media-views-test.js')
-rw-r--r--tools/feed-media-views-test.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/feed-media-views-test.js b/tools/feed-media-views-test.js
index 87bf3cf..1eac95c 100644
--- a/tools/feed-media-views-test.js
+++ b/tools/feed-media-views-test.js
@@ -95,7 +95,8 @@ const pagerState = () => page.evaluate(() => {
const p = document.querySelector('.media-pager');
if (!p) return null;
const sc = p.querySelector('.mp-scroll');
- const slides = [...sc.querySelectorAll('.mp-slide')]; // (not the loading screen at the end)
+ // (not the loading screen at the end, nor a clip held out for its shape)
+ const slides = [...sc.querySelectorAll('.mp-slide')].filter((x) => !x.closest('.mp-off'));
const i = slides.findIndex((x) => { const r = x.getBoundingClientRect(); return Math.abs(r.top) < 4 && Math.abs(r.left) < 4; }); // the slide on screen
const vids = slides.map((s) => s.querySelector('video'));
return { n: slides.length, i, src: (slides[i]?.querySelector('.mp-media')?.getAttribute('data-src') || '').split('/').pop(),
@@ -201,7 +202,7 @@ try {
const vi = await info();
check('a probe reads the size, ranges, layout and picture size from 64 KB', vi['a.mp4']?.probed && vi['a.mp4'].ranges && vi['a.mp4'].faststart
&& vi['a.mp4'].size > 1000 && vi['a.mp4'].w === 360 && vi['a.mp4'].h === 640, JSON.stringify(vi['a.mp4']));
- check('the landscape clip is left out of Videos', !(await page.evaluate(() => [...document.querySelectorAll('.media-pager video')].some((v) => /slow/.test(v.getAttribute('data-src'))))));
+ check('the landscape clip is left out of Videos', !(await page.evaluate(() => [...document.querySelectorAll('.media-pager video')].some((v) => /slow/.test(v.getAttribute('data-src')) && !v.closest('.mp-off')))));
check('an index-last file from a server without ranges is seen for what it is', vi['slow.mp4']?.probed && vi['slow.mp4'].faststart === false && vi['slow.mp4'].ranges === false, JSON.stringify(vi['slow.mp4']));
check('the 50 MB clip is known as such before any of it plays', vi['c.mp4']?.size === 50000000, JSON.stringify(vi['c.mp4']));
await page.keyboard.press('ArrowDown'); await sleep(1200);