diff options
Diffstat (limited to 'tests/src/com/android/launcher3/util/rule/ViewCaptureRule.kt')
-rw-r--r-- | tests/src/com/android/launcher3/util/rule/ViewCaptureRule.kt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/src/com/android/launcher3/util/rule/ViewCaptureRule.kt b/tests/src/com/android/launcher3/util/rule/ViewCaptureRule.kt index ccbae4fb0c..e70ea18f7a 100644 --- a/tests/src/com/android/launcher3/util/rule/ViewCaptureRule.kt +++ b/tests/src/com/android/launcher3/util/rule/ViewCaptureRule.kt @@ -132,7 +132,9 @@ class ViewCaptureRule(var alreadyOpenActivitySupplier: Supplier<Activity?>) : Te for (i in 0 until viewCaptureData!!.windowDataCount) { frameCount += viewCaptureData!!.getWindowData(i).frameDataCount } - assertTrue("Empty ViewCapture data", frameCount > 0) + + val mayProduceNoFrames = description.getAnnotation(MayProduceNoFrames::class.java) != null + assertTrue("Empty ViewCapture data", mayProduceNoFrames || frameCount > 0) val anomalies: Map<String, String> = ViewCaptureAnalyzer.getAnomalies(viewCaptureData) if (!anomalies.isEmpty()) { @@ -159,4 +161,8 @@ class ViewCaptureRule(var alreadyOpenActivitySupplier: Supplier<Activity?>) : Te ) } } + + @Retention(AnnotationRetention.RUNTIME) + @Target(AnnotationTarget.FUNCTION) + annotation class MayProduceNoFrames } |