Android waitForMonitorWithTimeout方法不起作用

Jac*_*ack 2 android

我正在使用Instrumentation编写自动化测试用例."waitforMonitorWithTimeout"总是超时.如果我使用waitForMonitor一切都很好.这两行代码如下.(我在构建我的测试项目时注释掉其中一个).

Activity currentActivity = instrumentation.waitForMonitorWithTimeout(monitor,(long)30);

Activity currentActivity = instrumentation.waitForMonitor(monitor);

"waitforMonitorWithTimeout"是否存在已知问题?我必须使用超时来确定是否发生了事件(从而转换到新活动).

Jac*_*ack 7

我发现了我的问题 - 文档说明延迟是以单位.实际上延迟是以毫秒为单位.(至少在eclipse/Android领域就是这种情况).当我使用30000而不是30时 - 尝试延迟30秒 - 事情变得更好.