# Cookies encrypted at rest (S025, R1-19), part 1: sign in to a loopback site and quit. Offline, never Tor or proxies.
# Start the server first:  python3 tests/smoke/net/server.py &
# Run (own throwaway keyring):  SMOKE_KEYRING=1 tools/smoke.sh tests/smoke/cookies.txt <out>
# Then part 2 with the same home:  SMOKE_KEYRING=1 SMOKE_HOME=<out>/home tools/smoke.sh tests/smoke/cookies-restart.txt
# Check afterwards: no engine/cookie_jar.json, `grep -r nacre-test-session <out>/home` finds nothing, cookies.bin exists (the title "Signed in as smoke" is in history, the cookie value never).
wait 3
set /vpn/enabled false
set /privacy/https_only false
wait 1
open http://127.0.0.1:8767/login?user=smoke
waitfor 20 document.title === "Signed in smoke"
open http://127.0.0.1:8767/whoami
waitfor 20 document.title === "Signed in as smoke"
# Longer than the store's 5 s save interval: the jar is on disk before quitting too.
wait 7
expect /cookies "Encrypted"
status done
quit
