From 869128526bf64b2fd2f8cae235442eaf84534d51 Mon Sep 17 00:00:00 2001 From: Mark Renouf Date: Fri, 2 Apr 2021 14:55:24 -0400 Subject: [PATCH] Improve logging in ScrollCaptureFrameworkSmokeTest In the event of failure, this change prints some very useful information such as, why no connection was returned and potentially the name of the window which was investigated. Bug: 184117155 Test: atest ScrollCaptureFrameworkSmokeTest Change-Id: Iecf5ef2d22d00773a08d0b2605391a4db0be9b21 --- .../screenshot/ScrollCaptureFrameworkSmokeTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/tests/src/com/android/systemui/screenshot/ScrollCaptureFrameworkSmokeTest.java b/packages/SystemUI/tests/src/com/android/systemui/screenshot/ScrollCaptureFrameworkSmokeTest.java index 06b39abd1d0e7..54d973266ff3d 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/screenshot/ScrollCaptureFrameworkSmokeTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/screenshot/ScrollCaptureFrameworkSmokeTest.java @@ -82,7 +82,11 @@ public class ScrollCaptureFrameworkSmokeTest extends SysuiTestCase { latch.await(1000, TimeUnit.MILLISECONDS); assertNotNull(mResponse); - assertTrue(mResponse.isConnected()); - assertTrue(mResponse.getWindowTitle().contains(ScrollViewActivity.class.getSimpleName())); + if (!mResponse.isConnected()) { + Log.e(TAG, "Received response with no connection: " + mResponse); + fail("expected response.isConnected() == true"); + } + assertTrue("expected a connection to ScrollViewActivity", + mResponse.getWindowTitle().contains(ScrollViewActivity.class.getSimpleName())); } }