summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-08-24 03:06:26 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-08-24 03:06:26 +0000
commit35c38998482f25f9000a9f8e86aa793a73e52bf5 (patch)
tree4f7ac31af8239d473bdba6f5dbf7749dd0c73a4a
parent6d8923e24d19b53c77243994b3129d8df7533b27 (diff)
parent27fc734a998711e94dfe526af050f0faa062cffd (diff)
downloadcts-pie-qpr1-s1-release.tar.gz
Change-Id: I37cc6a9ca7b6784dea07528b9480fded8e0025f6
-rw-r--r--apps/CtsVerifier/src/com/android/cts/verifier/dialer/DialerImplementsTelecomIntentsActivity.java11
-rw-r--r--hostsidetests/appsecurity/src/android/appsecurity/cts/ApplicationVisibilityTest.java42
-rw-r--r--hostsidetests/security/src/android/security/cts/Poc16_10.java3
-rw-r--r--tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityMagnificationTest.java11
-rw-r--r--tests/tests/graphics/jni/android_graphics_cts_MediaVulkanGpuTest.cpp32
-rw-r--r--tests/tests/keystore/src/android/keystore/cts/CipherTest.java22
-rw-r--r--tests/tests/media/src/android/media/cts/VpxEncoderTest.java7
-rw-r--r--tests/tests/security/src/android/security/cts/ListeningPortsTest.java12
-rw-r--r--tests/tests/systemui/AndroidTest.xml7
-rw-r--r--tests/tests/systemui/src/android/systemui/cts/LightBarTestBase.java22
-rw-r--r--tests/tests/systemui/src/android/systemui/cts/LightBarTests.java8
-rw-r--r--tests/tests/systemui/src/android/systemui/cts/LightBarThemeTest.java7
12 files changed, 134 insertions, 50 deletions
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/dialer/DialerImplementsTelecomIntentsActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/dialer/DialerImplementsTelecomIntentsActivity.java
index bc5cdbc8fac..a7f0a957e2f 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/dialer/DialerImplementsTelecomIntentsActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/dialer/DialerImplementsTelecomIntentsActivity.java
@@ -17,12 +17,15 @@
package com.android.cts.verifier.dialer;
import android.content.Intent;
+import android.content.Context;
import android.os.Bundle;
import android.telecom.TelecomManager;
+import android.telephony.TelephonyManager;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
+
import com.android.cts.verifier.PassFailButtons;
import com.android.cts.verifier.R;
@@ -37,6 +40,7 @@ public class DialerImplementsTelecomIntentsActivity extends PassFailButtons.Acti
private CheckBox mLaunchCallingAccountsSettingsCheckBox;
private Button mLaunchAccessibilitySettingsButton;
private CheckBox mLaunchAccessibilitySettingsCheckBox;
+ private TelephonyManager mTelephonyManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -50,6 +54,8 @@ public class DialerImplementsTelecomIntentsActivity extends PassFailButtons.Acti
setPassFailButtonClickListeners();
getPassButton().setEnabled(false);
+ mTelephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
+
mLaunchCallSettingsCheckBox = findViewById(R.id.dialer_telecom_intents_call_settings_check_box);
mLaunchShortSmsAnswerCheckBox = findViewById(R.id.dialer_telecom_intents_short_sms_check_box);
mLaunchCallingAccountsSettingsCheckBox =
@@ -85,6 +91,11 @@ public class DialerImplementsTelecomIntentsActivity extends PassFailButtons.Acti
mLaunchAccessibilitySettingsButton.setOnClickListener(
(View unused) ->
startActivity(new Intent(TelecomManager.ACTION_SHOW_CALL_ACCESSIBILITY_SETTINGS)));
+ if (!mTelephonyManager.isHearingAidCompatibilitySupported() && !mTelephonyManager.isTtyModeSupported()) {
+ mLaunchAccessibilitySettingsButton.setVisibility(View.INVISIBLE);
+ mLaunchAccessibilitySettingsCheckBox.setVisibility(View.INVISIBLE);
+ mLaunchAccessibilitySettingsCheckBox.setChecked(true);
+ }
}
private void onCheckedChangeListener() {
diff --git a/hostsidetests/appsecurity/src/android/appsecurity/cts/ApplicationVisibilityTest.java b/hostsidetests/appsecurity/src/android/appsecurity/cts/ApplicationVisibilityTest.java
index 08d965c054a..aac5bd14e83 100644
--- a/hostsidetests/appsecurity/src/android/appsecurity/cts/ApplicationVisibilityTest.java
+++ b/hostsidetests/appsecurity/src/android/appsecurity/cts/ApplicationVisibilityTest.java
@@ -47,7 +47,7 @@ public class ApplicationVisibilityTest extends BaseAppSecurityTest {
@Before
public void setUpPackage() throws Exception {
- mUsers = Utils.prepareMultipleUsers(getDevice(), 3);
+ mUsers = Utils.prepareMultipleUsers(getDevice(), 2);
mOldVerifierValue =
getDevice().executeShellCommand("settings get global package_verifier_enable");
getDevice().executeShellCommand("settings put global package_verifier_enable 0");
@@ -68,8 +68,8 @@ public class ApplicationVisibilityTest extends BaseAppSecurityTest {
return;
}
- final int installUserId = mUsers[1];
- final int testUserId = mUsers[2];
+ final int installUserId = getInstallUserId();
+ final int testUserId = getTestUserId();
installTestAppForUser(TINY_APK, installUserId);
installTestAppForUser(TEST_WITH_PERMISSION_APK, testUserId);
@@ -99,8 +99,8 @@ public class ApplicationVisibilityTest extends BaseAppSecurityTest {
return;
}
- final int installUserId = mUsers[1];
- final int testUserId = mUsers[2];
+ final int installUserId = getInstallUserId();
+ final int testUserId = getTestUserId();
installTestAppForUser(TINY_APK, installUserId);
installTestAppForUser(TEST_WITH_PERMISSION_APK, testUserId);
@@ -126,8 +126,8 @@ public class ApplicationVisibilityTest extends BaseAppSecurityTest {
return;
}
- final int installUserId = mUsers[1];
- final int testUserId = mUsers[2];
+ final int installUserId = getInstallUserId();
+ final int testUserId = getTestUserId();
final Map<String, String> testArgs = new HashMap<>();
testArgs.put("testUser", Integer.toString(installUserId));
@@ -154,8 +154,8 @@ public class ApplicationVisibilityTest extends BaseAppSecurityTest {
return;
}
- final int installUserId = mUsers[1];
- final int testUserId = mUsers[2];
+ final int installUserId = getInstallUserId();
+ final int testUserId = getTestUserId();
final Map<String, String> testArgs = new HashMap<>();
testArgs.put("testUser", Integer.toString(installUserId));
@@ -178,8 +178,8 @@ public class ApplicationVisibilityTest extends BaseAppSecurityTest {
return;
}
- final int installUserId = mUsers[1];
- final int testUserId = mUsers[2];
+ final int installUserId = getInstallUserId();
+ final int testUserId = getTestUserId();
installTestAppForUser(TINY_APK, installUserId);
installTestAppForUser(TEST_WITH_PERMISSION_APK, testUserId);
@@ -209,8 +209,8 @@ public class ApplicationVisibilityTest extends BaseAppSecurityTest {
return;
}
- final int installUserId = mUsers[1];
- final int testUserId = mUsers[2];
+ final int installUserId = getInstallUserId();
+ final int testUserId = getTestUserId();
installTestAppForUser(TINY_APK, installUserId);
installTestAppForUser(TEST_WITH_PERMISSION_APK, testUserId);
@@ -236,8 +236,8 @@ public class ApplicationVisibilityTest extends BaseAppSecurityTest {
return;
}
- final int installUserId = mUsers[1];
- final int testUserId = mUsers[2];
+ final int installUserId = getInstallUserId();
+ final int testUserId = getTestUserId();
final Map<String, String> testArgs = new HashMap<>();
testArgs.put("testUser", Integer.toString(installUserId));
@@ -264,8 +264,8 @@ public class ApplicationVisibilityTest extends BaseAppSecurityTest {
return;
}
- final int installUserId = mUsers[1];
- final int testUserId = mUsers[2];
+ final int installUserId = getInstallUserId();
+ final int testUserId = getTestUserId();
final Map<String, String> testArgs = new HashMap<>();
testArgs.put("testUser", Integer.toString(installUserId));
@@ -280,4 +280,12 @@ public class ApplicationVisibilityTest extends BaseAppSecurityTest {
testUserId,
testArgs);
}
+
+ private int getInstallUserId() {
+ return mUsers[0];
+ }
+
+ private int getTestUserId() {
+ return mUsers[1];
+ }
}
diff --git a/hostsidetests/security/src/android/security/cts/Poc16_10.java b/hostsidetests/security/src/android/security/cts/Poc16_10.java
index 5641aee0667..df116d4e6f3 100644
--- a/hostsidetests/security/src/android/security/cts/Poc16_10.java
+++ b/hostsidetests/security/src/android/security/cts/Poc16_10.java
@@ -106,5 +106,8 @@ public class Poc16_10 extends SecurityTestCase {
assertNotMatches("[\\s\\n\\S]*Fatal signal 11 \\(SIGSEGV\\)" +
"[\\s\\n\\S]*>>> /system/bin/" +
"mediaserver <<<[\\s\\n\\S]*", logcat);
+
+ //make sure the app is uninstalled after the test
+ AdbUtils.runCommandLine("pm uninstall com.trendmicro.wish_wu.camera2" , getDevice());
}
}
diff --git a/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityMagnificationTest.java b/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityMagnificationTest.java
index c5745413b58..ebb711b6c1c 100644
--- a/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityMagnificationTest.java
+++ b/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityMagnificationTest.java
@@ -28,6 +28,7 @@ import android.accessibilityservice.AccessibilityService.MagnificationController
import android.accessibilityservice.AccessibilityServiceInfo;
import android.app.Instrumentation;
import android.content.Context;
+import android.graphics.Rect;
import android.graphics.Region;
import android.platform.test.annotations.AppModeFull;
import android.test.InstrumentationTestCase;
@@ -89,13 +90,11 @@ public class AccessibilityMagnificationTest extends InstrumentationTestCase {
public void testSetScaleAndCenter() {
final MagnificationController controller = mService.getMagnificationController();
- final WindowManager wm = (WindowManager) mInstrumentation.getContext().getSystemService(
- Context.WINDOW_SERVICE);
- final DisplayMetrics metrics = new DisplayMetrics();
- wm.getDefaultDisplay().getRealMetrics(metrics);
+ final Region region = controller.getMagnificationRegion();
+ final Rect bounds = region.getBounds();
final float scale = 2.0f;
- final float x = metrics.widthPixels / 4.0f;
- final float y = metrics.heightPixels / 4.0f;
+ final float x = bounds.left + (bounds.width() / 4.0f);
+ final float y = bounds.top + (bounds.height() / 4.0f);
final AtomicBoolean setScale = new AtomicBoolean();
final AtomicBoolean setCenter = new AtomicBoolean();
final AtomicBoolean result = new AtomicBoolean();
diff --git a/tests/tests/graphics/jni/android_graphics_cts_MediaVulkanGpuTest.cpp b/tests/tests/graphics/jni/android_graphics_cts_MediaVulkanGpuTest.cpp
index 9bee99cee29..fd570a8e526 100644
--- a/tests/tests/graphics/jni/android_graphics_cts_MediaVulkanGpuTest.cpp
+++ b/tests/tests/graphics/jni/android_graphics_cts_MediaVulkanGpuTest.cpp
@@ -76,9 +76,6 @@ static void loadMediaAndVerifyFrameImport(JNIEnv *env, jclass, jobject assetMgr,
// Could not initialize Vulkan due to lack of device support, skip test.
return;
}
- VkImageRenderer renderer(&init, kTestImageWidth, kTestImageHeight,
- VK_FORMAT_R8G8B8A8_UNORM, 4);
- ASSERT(renderer.init(env, assetMgr), "Could not init VkImageRenderer.");
// Set up the image reader and media helpers used to get a frames from video.
ImageReaderHelper imageReader(kTestImageWidth, kTestImageHeight,
@@ -100,9 +97,23 @@ static void loadMediaAndVerifyFrameImport(JNIEnv *env, jclass, jobject assetMgr,
ret = imageReader.getBufferFromCurrentImage(&buffer);
}
+ // Read the width/height of the produced AHardwareBuffer. AImageReader may round up from our
+ // expected video size.
+ AHardwareBuffer_Desc bufferDesc;
+ AHardwareBuffer_describe(buffer, &bufferDesc);
+ // The AImageReader may round up the size of the AHardwareBuffer returned.
+ ASSERT(bufferDesc.width >= kTestImageWidth, "Unexpectedly small image width read from video.");
+ ASSERT(bufferDesc.height >= kTestImageHeight, "Unexpectedly small image height read from video.");
+
+ // Create a VkImageRenderer with the actual width/height of the AHardwareBuffer.
+ VkImageRenderer renderer(&init, bufferDesc.width, bufferDesc.height,
+ VK_FORMAT_R8G8B8A8_UNORM, 4);
+ ASSERT(renderer.init(env, assetMgr), "Could not init VkImageRenderer.");
+
// Import the AHardwareBuffer into Vulkan.
VkAHardwareBufferImage vkImage(&init);
- ASSERT(vkImage.init(buffer, true /* useExternalFormat */), "Could not init VkAHardwareBufferImage.");
+ ASSERT(vkImage.init(buffer, true /* useExternalFormat */),
+ "Could not init VkAHardwareBufferImage.");
// Render the AHardwareBuffer using Vulkan and read back the result.
std::vector<uint32_t> framePixels;
@@ -110,23 +121,24 @@ static void loadMediaAndVerifyFrameImport(JNIEnv *env, jclass, jobject assetMgr,
vkImage.image(), vkImage.sampler(), vkImage.view(),
vkImage.semaphore(), vkImage.isSamplerImmutable(), &framePixels),
"Could not get frame pixels from Vulkan.");
- ASSERT(framePixels.size() == kTestImageWidth * kTestImageHeight,
+ ASSERT(framePixels.size() == bufferDesc.width * bufferDesc.height,
"Unexpected number of pixels in frame");
// Ensure that the data we read back matches our reference image.
size_t referenceSize =
static_cast<size_t>(env->GetArrayLength(referencePixels));
- ASSERT(framePixels.size() == referenceSize,
- "Unexpected number of pixels in frame.");
+ ASSERT(referenceSize == kTestImageWidth * kTestImageHeight,
+ "Unexpected number of pixels in reference image.");
uint32_t *referenceData = reinterpret_cast<uint32_t *>(
env->GetIntArrayElements(referencePixels, 0));
for (uint32_t x = 0; x < kTestImageWidth; ++x) {
for (uint32_t y = 0; y < kTestImageHeight; ++y) {
- size_t offset = y * kTestImageWidth + x;
+ size_t frame_offset = y * bufferDesc.width + x;
+ size_t reference_offset = y * kTestImageWidth + x;
static const int32_t kTolerance = 0x30;
- uint32_t value1 = framePixels[offset];
+ uint32_t value1 = framePixels[frame_offset];
// Reference data is BGRA, Vk data is BGRA.
- uint32_t value2 = swizzleBgraToRgba(referenceData[offset]);
+ uint32_t value2 = swizzleBgraToRgba(referenceData[reference_offset]);
ASSERT(fuzzyMatch(value1, value2, kTolerance),
"Expected ~0x%08X at (%i,%i), got 0x%08X", value2, x, y, value1);
}
diff --git a/tests/tests/keystore/src/android/keystore/cts/CipherTest.java b/tests/tests/keystore/src/android/keystore/cts/CipherTest.java
index 66404b2ab26..e75a60ff26a 100644
--- a/tests/tests/keystore/src/android/keystore/cts/CipherTest.java
+++ b/tests/tests/keystore/src/android/keystore/cts/CipherTest.java
@@ -18,6 +18,7 @@ package android.keystore.cts;
import android.app.KeyguardManager;
import android.content.Context;
+import android.content.pm.PackageManager;
import android.os.SystemClock;
import android.platform.test.annotations.Presubmit;
import android.security.keystore.KeyGenParameterSpec;
@@ -439,9 +440,18 @@ public class CipherTest extends AndroidTestCase {
}
}
+ private boolean isLeanbackOnly() {
+ PackageManager pm = getContext().getPackageManager();
+ return (pm != null && pm.hasSystemFeature("android.software.leanback_only"));
+ }
+
@Presubmit
public void testKeyguardLockAndUnlock()
throws Exception {
+ if (isLeanbackOnly()) {
+ return;
+ }
+
try (DeviceLockSession dl = new DeviceLockSession()) {
KeyguardManager keyguardManager = (KeyguardManager)getContext()
.getSystemService(Context.KEYGUARD_SERVICE);
@@ -459,6 +469,10 @@ public class CipherTest extends AndroidTestCase {
final boolean isUnlockedDeviceRequired = true;
final boolean isUserAuthRequired = false;
+ if (isLeanbackOnly()) {
+ return;
+ }
+
try (DeviceLockSession dl = new DeviceLockSession()) {
KeyguardManager keyguardManager = (KeyguardManager)getContext()
.getSystemService(Context.KEYGUARD_SERVICE);
@@ -947,6 +961,10 @@ public class CipherTest extends AndroidTestCase {
final boolean isUnlockedDeviceRequired = false;
final boolean isUserAuthRequired = true;
+ if (isLeanbackOnly()) {
+ return;
+ }
+
try (DeviceLockSession dl = new DeviceLockSession()) {
KeyguardManager keyguardManager = (KeyguardManager)getContext().getSystemService(Context.KEYGUARD_SERVICE);
@@ -970,6 +988,10 @@ public class CipherTest extends AndroidTestCase {
final boolean isUserAuthRequired = true;
final boolean isUnlockedDeviceRequired = false;
+ if (isLeanbackOnly()) {
+ return;
+ }
+
KeyguardManager keyguardManager = (KeyguardManager)getContext().getSystemService(Context.KEYGUARD_SERVICE);
assertFalse(keyguardManager.isDeviceLocked());
diff --git a/tests/tests/media/src/android/media/cts/VpxEncoderTest.java b/tests/tests/media/src/android/media/cts/VpxEncoderTest.java
index f94a56691c6..38a84034c4f 100644
--- a/tests/tests/media/src/android/media/cts/VpxEncoderTest.java
+++ b/tests/tests/media/src/android/media/cts/VpxEncoderTest.java
@@ -107,10 +107,15 @@ public class VpxEncoderTest extends VpxCodecTestBase {
VpxEncodingStatistics statistics = computeEncodingStatistics(bufInfo);
- assertEquals("Stream bitrate " + statistics.mAverageBitrate +
+ /* Allow achieved bitrate to be smaller than target bitrate for
+ * VIDEO_ControlRateVariable mode */
+ if ((params.bitrateType == VIDEO_ControlRateConstant) ||
+ (statistics.mAverageBitrate > targetBitrate)) {
+ assertEquals("Stream bitrate " + statistics.mAverageBitrate +
" is different from the target " + targetBitrate,
targetBitrate, statistics.mAverageBitrate,
MAX_BITRATE_VARIATION * targetBitrate);
+ }
decode(params.outputIvfFilename, null, codecMimeType, FPS, params.forceGoogleEncoder);
}
diff --git a/tests/tests/security/src/android/security/cts/ListeningPortsTest.java b/tests/tests/security/src/android/security/cts/ListeningPortsTest.java
index 2688ba2b30c..6d7c5e2f487 100644
--- a/tests/tests/security/src/android/security/cts/ListeningPortsTest.java
+++ b/tests/tests/security/src/android/security/cts/ListeningPortsTest.java
@@ -232,13 +232,11 @@ public class ListeningPortsTest extends AndroidTestCase {
if (isTcp && !isTcpConnectable(entry.localAddress, entry.port)) {
continue;
}
- // allow non-system processes to listen on a device with TV capabilities
- if (mIsTelevision) {
- int appId = UserHandle.getAppId(entry.uid);
- if (appId >= Process.FIRST_APPLICATION_UID
- && appId <= Process.LAST_APPLICATION_UID) {
- continue;
- }
+ // allow non-system processes to listen
+ int appId = UserHandle.getAppId(entry.uid);
+ if (appId >= Process.FIRST_APPLICATION_UID
+ && appId <= Process.LAST_APPLICATION_UID) {
+ continue;
}
errors += "\nFound port listening on addr="
diff --git a/tests/tests/systemui/AndroidTest.xml b/tests/tests/systemui/AndroidTest.xml
index 208f8443bef..e7852c57243 100644
--- a/tests/tests/systemui/AndroidTest.xml
+++ b/tests/tests/systemui/AndroidTest.xml
@@ -25,4 +25,11 @@
<option name="package" value="android.systemui.cts" />
<option name="runtime-hint" value="10m19s" />
</test>
+
+ <!-- Collect the files in the dump directory for debugging -->
+ <metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector">
+ <option name="directory-keys" value="/sdcard/LightBarTestBase/" />
+ <option name="collect-on-run-ended-only" value="true" />
+ </metrics_collector>
+
</configuration>
diff --git a/tests/tests/systemui/src/android/systemui/cts/LightBarTestBase.java b/tests/tests/systemui/src/android/systemui/cts/LightBarTestBase.java
index 7a2dc2d6b1a..dde2ce1029a 100644
--- a/tests/tests/systemui/src/android/systemui/cts/LightBarTestBase.java
+++ b/tests/tests/systemui/src/android/systemui/cts/LightBarTestBase.java
@@ -32,14 +32,18 @@ import android.util.Log;
import android.view.KeyEvent;
import android.view.WindowInsets;
+import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.nio.file.FileSystems;
+import java.nio.file.Path;
public class LightBarTestBase {
private static final String TAG = "LightBarTestBase";
- public static final String DUMP_PATH = "/sdcard/lightstatustest.png";
+ public static final Path DUMP_PATH = FileSystems.getDefault()
+ .getPath("/sdcard/LightBarTestBase/");
protected Bitmap takeStatusBarScreenshot(LightBarBaseActivity activity) {
Bitmap fullBitmap = getInstrumentation().getUiAutomation().takeScreenshot();
@@ -52,11 +56,17 @@ public class LightBarTestBase {
fullBitmap.getHeight() - activity.getBottom());
}
- protected void dumpBitmap(Bitmap bitmap) {
- Log.e(TAG, "Dumping failed bitmap to " + DUMP_PATH);
+ protected void dumpBitmap(Bitmap bitmap, String name) {
+ File dumpDir = DUMP_PATH.toFile();
+ if (!dumpDir.exists()) {
+ dumpDir.mkdirs();
+ }
+
+ Path filePath = DUMP_PATH.resolve(name + ".png");
+ Log.e(TAG, "Dumping failed bitmap to " + filePath);
FileOutputStream fileStream = null;
try {
- fileStream = new FileOutputStream(DUMP_PATH);
+ fileStream = new FileOutputStream(filePath.toFile());
bitmap.compress(Bitmap.CompressFormat.PNG, 85, fileStream);
fileStream.flush();
} catch (Exception e) {
@@ -129,7 +139,7 @@ public class LightBarTestBase {
}
protected void checkNavigationBarDivider(LightBarBaseActivity activity, int dividerColor,
- int backgroundColor) {
+ int backgroundColor, String methodName) {
final Bitmap bitmap = takeNavigationBarScreenshot(activity);
int[] pixels = new int[bitmap.getHeight() * bitmap.getWidth()];
bitmap.getPixels(pixels, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight());
@@ -144,7 +154,7 @@ public class LightBarTestBase {
for (int col = 0; col < bitmap.getWidth(); col++) {
if (dividerColor != pixels[col]) {
- dumpBitmap(bitmap);
+ dumpBitmap(bitmap, methodName);
fail("Invalid color exptected=" + dividerColor + " actual=" + pixels[col]);
}
}
diff --git a/tests/tests/systemui/src/android/systemui/cts/LightBarTests.java b/tests/tests/systemui/src/android/systemui/cts/LightBarTests.java
index fc7e70fe2cd..3f860679753 100644
--- a/tests/tests/systemui/src/android/systemui/cts/LightBarTests.java
+++ b/tests/tests/systemui/src/android/systemui/cts/LightBarTests.java
@@ -38,6 +38,7 @@ import android.view.MotionEvent;
import org.junit.Rule;
import org.junit.Test;
+import org.junit.rules.TestName;
import org.junit.runner.RunWith;
/**
@@ -66,6 +67,8 @@ public class LightBarTests extends LightBarTestBase {
@Rule
public ActivityTestRule<LightBarActivity> mActivityRule = new ActivityTestRule<>(
LightBarActivity.class);
+ @Rule
+ public TestName mTestName = new TestName();
@Test
@AppModeFull // Instant apps cannot create notifications
@@ -128,7 +131,8 @@ public class LightBarTests extends LightBarTestBase {
});
Thread.sleep(WAIT_TIME);
- checkNavigationBarDivider(mActivityRule.getActivity(), Color.WHITE, Color.RED);
+ checkNavigationBarDivider(mActivityRule.getActivity(), Color.WHITE, Color.RED,
+ mTestName.getMethodName());
}
private void injectCanceledTap(int x, int y) {
@@ -167,7 +171,7 @@ public class LightBarTests extends LightBarTestBase {
success = true;
} finally {
if (!success) {
- dumpBitmap(bitmap);
+ dumpBitmap(bitmap, mTestName.getMethodName());
}
}
}
diff --git a/tests/tests/systemui/src/android/systemui/cts/LightBarThemeTest.java b/tests/tests/systemui/src/android/systemui/cts/LightBarThemeTest.java
index 4d20dfb14a2..207b321db3c 100644
--- a/tests/tests/systemui/src/android/systemui/cts/LightBarThemeTest.java
+++ b/tests/tests/systemui/src/android/systemui/cts/LightBarThemeTest.java
@@ -33,6 +33,7 @@ import android.view.View;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
+import org.junit.rules.TestName;
import org.junit.runner.RunWith;
/**
@@ -49,6 +50,9 @@ public class LightBarThemeTest extends LightBarTestBase {
public ActivityTestRule<LightBarThemeActivity> mActivityRule = new ActivityTestRule<>(
LightBarThemeActivity.class);
+ @Rule
+ public TestName mTestName = new TestName();
+
@Before
public void setUp() {
mDevice = UiDevice.getInstance(getInstrumentation());
@@ -79,6 +83,7 @@ public class LightBarThemeTest extends LightBarTestBase {
final Context instrumentationContext = getInstrumentation().getContext();
checkNavigationBarDivider(mActivityRule.getActivity(),
instrumentationContext.getColor(R.color.navigationBarDividerColor),
- instrumentationContext.getColor(R.color.navigationBarColor));
+ instrumentationContext.getColor(R.color.navigationBarColor),
+ mTestName.getMethodName());
}
}