aboutsummaryrefslogtreecommitdiffstats
path: root/tools/fullscreen-notice-test.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/fullscreen-notice-test.js')
-rw-r--r--tools/fullscreen-notice-test.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/fullscreen-notice-test.js b/tools/fullscreen-notice-test.js
index c5658ea..cf15f8c 100644
--- a/tools/fullscreen-notice-test.js
+++ b/tools/fullscreen-notice-test.js
@@ -93,7 +93,7 @@ async function run(lockOk) {
await waitText('receive', 20000);
await page.evaluate(() => document.querySelector('.app-nav-button[aria-label="Feed"]').click());
await page.waitForSelector('.notes-feed video.note-video', { timeout: 20000 });
- check('a feed clip\'s bar has no full-screen button', await waitFor(() => [...document.querySelectorAll('.notes-feed video.note-video')].every((v) => v.getAttribute('controlslist') === 'nofullscreen'), null, 5000));
+ check('a feed clip\'s bar keeps its full-screen button (not greyed out)', await page.evaluate(() => [...document.querySelectorAll('.notes-feed video.note-video')].every((v) => !/nofullscreen/.test(v.getAttribute('controlslist') || ''))));
await openClip('a wide one');
await sleep(1200);
let s = await st();
@@ -103,6 +103,16 @@ async function run(lockOk) {
await page.keyboard.press('ArrowDown'); await sleep(1200);
await page.keyboard.press('Escape');
check('Escape closes it', await waitFor(() => !document.querySelector('.media-pager') && !document.fullscreenElement, null, 3000));
+ // the player's own full-screen button: the pager, on that clip
+ await page.evaluate(() => { const r = [...document.querySelectorAll('.notes-feed [data-key]')].find((n) => n.textContent.includes('a tall one')); r.querySelector('video.note-video').scrollIntoView({ block: 'center' }); });
+ await sleep(400);
+ await page.evaluate(() => [...document.querySelectorAll('.notes-feed [data-key]')].find((n) => n.textContent.includes('a tall one')).querySelector('video.note-video').requestFullscreen());
+ check('its full-screen button opens the pager', await waitFor(() => !!document.querySelector('.media-pager.videos'), null, 4000), JSON.stringify(await st()));
+ check('…on that clip', await waitFor(() => { const s = [...document.querySelectorAll('.mp-slide')].find((x) => { const r = x.getBoundingClientRect(); return Math.abs(r.top) < 4 && Math.abs(r.left) < 4; }); return !!s && /tall/.test(s.getAttribute('data-k') || ''); }, null, 3000));
+ check('…and the clip itself isn\'t left full screen', await waitFor(() => !(document.fullscreenElement && document.fullscreenElement.matches('video.note-video')), null, 3000));
+ await page.keyboard.press('Escape');
+ check('Escape closes that too', await waitFor(() => !document.querySelector('.media-pager'), null, 3000));
+ await sleep(600);
await openClip('a tall one'); await sleep(1200);
s = await st();
check('a tall clip: the pager, no full screen, the screen left alone', s.open && !s.fs && !s.orient.some((x) => x.startsWith('lock')), JSON.stringify(s));