refactor tests to use helper function testInIFrame()