我的页面中定义了一个html colorpicker。像这样:
@RunWith(PowerMockRunner.class)
@PrepareForTest(aClass.class)
public class aClassTesting {
@Mock
bClass mockB;
@Test
public void testMeth1(){
//prepare mocks
whenNew(bClass.class).withNoArguments().thenReturn(mockB);
doNothing().when(mockB).meth2();
//run it
aClass instance = new aClass();
aClass.meth1();
//asserts and verify
verifyNew(bClass.class).withNoArguments();
verify(mockB, times(1)).meth2();
}
}

这在firefox,chrome,IE上运行正常......除了Safari。
任何选项?