Dialog windows tests

All in this function from #641.