# HTTP disk cache across a restart (R1-04, S007): after tests/smoke/cache.txt fetched the stylesheet once, a new run
# on the same profile shows the page with it and the server still counts one fetch. Offline. Keep the same server
# running for both runs:
#   python3 tests/smoke/cache/server.py &
#   tools/smoke.sh tests/smoke/cache.txt target/smoke/cache-a
#   SMOKE_HOME=target/smoke/cache-a/home tools/smoke.sh tests/smoke/cache-restart.txt
wait 3
open http://127.0.0.1:8765/
waitfor 20 document.title === "Cache" && getComputedStyle(document.body).backgroundColor === "rgb(34, 170, 119)"
js fetch("/count").then(r => r.text()).then(t => { window.count = t; })
waitfor 5 window.count !== undefined
js window.count
assert window.count === "1"
status done
quit
