diff options
author | Michael Kwan <mkwan@google.com> | 2016-10-25 14:32:26 -0700 |
---|---|---|
committer | Michael Kwan <mkwan@google.com> | 2016-10-25 21:34:40 +0000 |
commit | 670c270a760f5cd5f527ebc942d93ee3ff78574a (patch) | |
tree | bd5cf793887af4162e3e60f64945de26e02b3be4 | |
parent | e3024dd7b1d83d385fd644dfff82d76b05dcdda7 (diff) | |
download | platform_cts-670c270a760f5cd5f527ebc942d93ee3ff78574a.tar.gz platform_cts-670c270a760f5cd5f527ebc942d93ee3ff78574a.tar.bz2 platform_cts-670c270a760f5cd5f527ebc942d93ee3ff78574a.zip |
Fixed themes test for watches with different DPI settings.
Resolved issue caused by missing resources for DPI that applies
to watch devices only. As the test is skipped on watch type
devices, the fix makes the test ignores the missing resources
issue if the test is run on a watch type device.
Bug: 30124611
Change-Id: I0d0619d4b9390f6b664f2c73023d0f736bc1cdeb
-rw-r--r-- | hostsidetests/theme/src/android/theme/cts/ThemeHostTest.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/hostsidetests/theme/src/android/theme/cts/ThemeHostTest.java b/hostsidetests/theme/src/android/theme/cts/ThemeHostTest.java index e04a10b25e4..eb2cb80ad9c 100644 --- a/hostsidetests/theme/src/android/theme/cts/ThemeHostTest.java +++ b/hostsidetests/theme/src/android/theme/cts/ThemeHostTest.java @@ -125,7 +125,7 @@ public class ThemeHostTest extends DeviceTestCase implements IAbiReceiver, IBuil mCompletionService = new ExecutorCompletionService<>(mExecutionService); } - private Map<String, File> extractReferenceImages(String zipFile) { + private Map<String, File> extractReferenceImages(String zipFile) throws Exception { final Map<String, File> references = new HashMap<>(); final InputStream zipStream = ThemeHostTest.class.getResourceAsStream(zipFile); if (zipStream != null) { @@ -150,7 +150,12 @@ public class ThemeHostTest extends DeviceTestCase implements IAbiReceiver, IBuil fail("Failed to unzip assets: " + zipFile); } } else { - fail("Failed to get resource: " + zipFile); + if (checkHardwareTypeSkipTest(mDevice.executeShellCommand(HARDWARE_TYPE_CMD).trim())) { + Log.logAndDisplay(LogLevel.WARN, LOG_TAG, + "Could not obtain resources for skipped themes test: " + zipFile); + } else { + fail("Failed to get resource: " + zipFile); + } } return references; |