test fix: implement replaceString in DocumentWindow