[BUG #7336] simplify test scenario and add possibility to inject window object