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
This commit is contained in:
Mark Renouf
2021-04-02 14:55:24 -04:00
parent be15324c5d
commit 869128526b

View File

@@ -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()));
}
}