我们如何找到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)`
I found some CTS errors which are given below:
Compatibility Test Case: CtsAppTestCases
Package Name: android.app.cts.DialogTest
Error:
-- 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)`
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此测试期望生命周期为 onPause() 然后为 onStop(),但调用的是 onResme() 而不是 onStop() 。
根据 Android Activity 文档 – “收到此电话后,您通常会收到对 onStop() 的后续调用(在恢复并显示下一个 Activity 后),但在某些情况下,会直接回调 onResume(),而不经过停止状态。”
因此,获得所需的序列并不是强制性的。
This Test is expecting the lifecycle as onPause() then onStop(), but onResme() was called rather than onStop().
According to Android Activity Docs – “After receiving this call you will usually receive a following call to onStop() (after the next activity has been resumed and displayed), however in some cases there will be a direct call back to onResume() without going through the stopped state.”
So, it is not mandatory to get desired sequence.