fix bug for osx test, make sure at least one window