Catch Throwable instead of Exception.

AssertionFailedError is a Throwable and hence some logs which will
help debug the failures are not printed.

Bug: 38384021
Test: Verified that when the test throws AssertionFailedError, required
      logs are printed.

Change-Id: I6cc8e0172b8e30d268a50bdf9281d6828fc74810
This commit is contained in:
Sudheer Shanka
2017-06-15 11:43:42 -07:00
parent 1f29891f4b
commit e0ea4b74fb

View File

@@ -812,7 +812,7 @@ abstract class AbstractRestrictBackgroundNetworkTestCase extends Instrumentation
executeSilentShellCommand("am set-inactive " + TEST_APP2_PKG + " " + enabled );
try {
assertAppIdle(enabled); // Sanity check
} catch (Exception e) {
} catch (Throwable e) {
final String afterStats = getUsageStatsDump();
Log.d(TAG, "UsageStats before:\n" + beforeStats);
Log.d(TAG, "UsageStats after:\n" + afterStats);