Fix window resize simulation in tests