我们如何找到CTS错误的原因?

时间:2011-09-22 11:07:19

标签: android testing cts

我发现了一些CTS错误,如下所示:

兼容性测试案例:CtsAppTestCases
包名称:android.app.cts.DialogTest

错误:

-- testContextMenu   fail   junit.framework.AssertionFailedError                      
                              at android.app.cts.DialogTest.testContextMenu(DialogTest.java:971)`

-- testTabScreen     fail   java.lang.RuntimeException: Intent {   
                              act=Activity lifecycle incorrect: received              
                              onResume but expected onStop at 5 }
                              at android.app.cts.ActivityTestsBase.waitForResultOrThrow(ActivityTestsBase.java:149)

-- testTabScreen     fail   java.lang.RuntimeException: Intent {   
                              act=Activity lifecycle incorrect: received              
                              onResume but expected onStop at 5 }
                              at android.app.cts.ActivityTestsBase.waitForResultOrThrow(ActivityTestsBase.java:149)

-- testScreen        fail   java.lang.RuntimeException: Intent { act=Activity
                            lifecycle incorrect: received onResume but expected onStop    
                              at 5 } 
                              at android.app.cts.ActivityTestsBase.waitForResultOrThrow(ActivityTestsBase.java:149)`

1 个答案:

答案 0 :(得分:0)

此测试期望生命周期为 onPause(),然后 onStop(),但 onResme()被调用而不是的onStop()即可。 根据{{​​3}} - “收到此电话后,您通常会收到以下呼叫onStop()(在下一个活动恢复并显示之后),但在某些情况下会有直接回拨到onResume()而不经过停止状态。“ 因此,并不是必须获得所需的序列。