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