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

发布于 2024-12-05 23:07:42 字数 1343 浏览 1 评论 0原文

我发现了一些 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梨涡少年 2024-12-12 23:07:42

此测试期望生命周期为 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文