changing helper function testInIFrame() according to Dominic's notes