# Painter cost (S005): memory and frame time with 5 and 15 tabs, then idle tabs releasing their painters.
# The status files carry "memory" (PSS bytes), "painters" (tabs holding a web view = painter) and "frames"
# (median/max draw time of the last frames). Run with SMOKE_TIMEOUT=400 tools/smoke.sh.
wait 3
set /perf/freeze_min 0
set /perf/discard_min 0
open @PAGES@/color.html?n=1&c=%23c01c28
waitload 30
wait 2
status m1-one-tab
newtab @PAGES@/color.html?n=2&c=%2326a269
waitload 30
newtab @PAGES@/color.html?n=3&c=%231c71d8
waitload 30
newtab @PAGES@/color.html?n=4&c=%23e5a50a
waitload 30
newtab @PAGES@/color.html?n=5&c=%23613583&anim=1
waitload 30
# The animated tab redraws every frame: wait so the frame list holds only those frames.
wait 5
status m5-five-tabs
newtab @PAGES@/color.html?n=6&c=%23c01c28
waitload 30
newtab @PAGES@/color.html?n=7&c=%2326a269
waitload 30
newtab @PAGES@/color.html?n=8&c=%231c71d8
waitload 30
newtab @PAGES@/color.html?n=9&c=%23e5a50a
waitload 30
newtab @PAGES@/color.html?n=10&c=%23613583
waitload 30
newtab @PAGES@/color.html?n=11&c=%23c01c28
waitload 30
newtab @PAGES@/color.html?n=12&c=%2326a269
waitload 30
newtab @PAGES@/color.html?n=13&c=%231c71d8
waitload 30
newtab @PAGES@/color.html?n=14&c=%23e5a50a
waitload 30
newtab @PAGES@/color.html?n=15&c=%23613583&anim=1
waitload 30
wait 5
status m15-fifteen-tabs
shot m15-fifteen-tabs
# Idle tabs unload after discard_min minutes (checked by the slow tick): 14 painters should go away.
set /perf/discard_min 1
wait 90
status m15-after-discard
shot m15-after-discard
# An unloaded tab loads again when shown.
cmd select 1
waitload 30
wait 1
shot m15-reloaded-tab2
status m15-reloaded
status done
quit
