Run focus test only if document has focus