# Picture in picture (S048): the tab's own view moves into the PiP window and back; the page keeps its state (no
# reload, video keeps playing). Offline. Run with tools/smoke.sh; read the PNGs.
wait 3
open @PAGES@/video.html
waitload
waitfor 10 document.getElementById('v').currentTime > 0.5
js window.marker = 42
cmd pip
wait 2
expect /active/pip true
expect /windows 2
shot pip-window pip
shot pip-tab
assert window.marker === 42 && !document.getElementById('v').paused && document.documentElement.classList.contains('__nacre_pip')
js window.t0 = document.getElementById('v').currentTime
wait 1.5
assert document.getElementById('v').currentTime !== window.t0
cmd exitpip
wait 1.5
expect /windows 1
expect /active/pip false
assert window.marker === 42 && !document.getElementById('v').paused && !document.documentElement.classList.contains('__nacre_pip')
shot pip-back
status done
quit
