summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-11-28 03:34:53 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-11-28 03:34:53 +0000
commit5544e82c0fc17676e042066558cbede8d0886c6a (patch)
tree5e86a0ce0f4eea77143c0fc188b0073bc6263fee
parent6072e690e254968c85465a669a2e2cd27bd9804b (diff)
parent614d7dcd14dbcd55864687a6b8b4e5395efc35ca (diff)
downloadcts-oreo-mr1-s1-release.tar.gz
Merge cherrypicks of [3276508, 3277765, 3277766, 3277904, 3276473, 3278009, 3278010, 3277767, 3277768, 3277769, 3277770, 3276509, 3276510, 3278011, 3278012, 3278013, 3278014, 3278099, 3278100, 3278101, 3278102, 3278103, 3278104, 3278105, 3278106, 3277800, 3276474, 3278015, 3278016, 3278017, 3278118, 3278119, 3278120, 3278121, 3278122, 3277946, 3277905, 3277947, 3277906, 3277751, 3278123, 3277752, 3278110, 3277771, 3277907, 3278095, 3277908, 3278111, 3277772, 3276475, 3276476] into oc-mr1-releaseandroid-wear-8.1.0_r1android-8.1.0_r6android-8.1.0_r5android-8.1.0_r4android-8.1.0_r3android-8.1.0_r19android-8.1.0_r16android-8.1.0_r15android-8.1.0_r12android-8.1.0_r11android-8.1.0_r10oreo-mr1-wear-releaseoreo-mr1-s1-releaseoreo-mr1-releaseoreo-mr1-cuttlefish-testing
Change-Id: Iac920044afeb929059a0be686719bbcd75dbc959
-rw-r--r--tests/tests/net/src/android/net/cts/UriTest.java5
-rw-r--r--tests/tests/security/res/raw/bug_67737022.mp4bin0 -> 102400 bytes
-rw-r--r--tests/tests/security/src/android/security/cts/BitmapTest.java41
-rw-r--r--tests/tests/security/src/android/security/cts/EffectBundleTest.java11
-rw-r--r--tests/tests/security/src/android/security/cts/StagefrightTest.java11
5 files changed, 68 insertions, 0 deletions
diff --git a/tests/tests/net/src/android/net/cts/UriTest.java b/tests/tests/net/src/android/net/cts/UriTest.java
index ab337d01837..05e826a2c45 100644
--- a/tests/tests/net/src/android/net/cts/UriTest.java
+++ b/tests/tests/net/src/android/net/cts/UriTest.java
@@ -109,6 +109,11 @@ public class UriTest extends AndroidTestCase {
uri = Uri.parse("http://localhost");
assertEquals("localhost", uri.getHost());
assertEquals(-1, uri.getPort());
+
+ uri = Uri.parse("http://a:a@example.com:a@example2.com/path");
+ assertEquals("a:a@example.com:a@example2.com", uri.getAuthority());
+ assertEquals("example2.com", uri.getHost());
+ assertEquals(-1, uri.getPort());
}
public void testCompareTo() {
diff --git a/tests/tests/security/res/raw/bug_67737022.mp4 b/tests/tests/security/res/raw/bug_67737022.mp4
new file mode 100644
index 00000000000..c2136e5498b
--- /dev/null
+++ b/tests/tests/security/res/raw/bug_67737022.mp4
Binary files differ
diff --git a/tests/tests/security/src/android/security/cts/BitmapTest.java b/tests/tests/security/src/android/security/cts/BitmapTest.java
new file mode 100644
index 00000000000..6253f0a35ca
--- /dev/null
+++ b/tests/tests/security/src/android/security/cts/BitmapTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.security.cts;
+
+import org.junit.runner.RunWith;
+import org.junit.Test;
+
+import android.graphics.Bitmap;
+import android.platform.test.annotations.SecurityTest;
+import android.support.test.runner.AndroidJUnit4;
+
+@SecurityTest
+@RunWith(AndroidJUnit4.class)
+public class BitmapTest {
+ /**
+ * Test Bitmap.createBitmap properly throws OOME on large inputs.
+ *
+ * A prior change in behavior resulted in throwing an NPE instead.
+ * OOME is more appropriate.
+ */
+ @Test(expected=OutOfMemoryError.class)
+ public void test_33846679() {
+ // This size is based on the max size possible in a GIF file,
+ // which might be passed to createBitmap from a Java decoder.
+ Bitmap.createBitmap(65535, 65535, Bitmap.Config.ARGB_8888);
+ }
+}
diff --git a/tests/tests/security/src/android/security/cts/EffectBundleTest.java b/tests/tests/security/src/android/security/cts/EffectBundleTest.java
index fb023337235..ae554941f70 100644
--- a/tests/tests/security/src/android/security/cts/EffectBundleTest.java
+++ b/tests/tests/security/src/android/security/cts/EffectBundleTest.java
@@ -19,6 +19,7 @@ package android.security.cts;
import android.media.audiofx.AudioEffect;
import android.media.audiofx.EnvironmentalReverb;
import android.media.audiofx.Equalizer;
+import android.media.audiofx.PresetReverb;
import android.media.MediaPlayer;
import android.platform.test.annotations.SecurityTest;
import android.test.InstrumentationTestCase;
@@ -247,6 +248,16 @@ public class EffectBundleTest extends InstrumentationTestCase {
);
}
+ //Testing security bug: 67647856
+ @SecurityTest
+ public void testPresetReverb_setParameter() throws Exception {
+ verifyZeroPVSizeRejectedForSetParameter(
+ AudioEffect.EFFECT_TYPE_PRESET_REVERB, new int[] {
+ PresetReverb.PARAM_PRESET
+ }
+ );
+ }
+
private boolean eqSetParamProperties(int media) {
MediaPlayer mp = null;
Equalizer eq = null;
diff --git a/tests/tests/security/src/android/security/cts/StagefrightTest.java b/tests/tests/security/src/android/security/cts/StagefrightTest.java
index 4e4830470e1..ee36ca8ef4c 100644
--- a/tests/tests/security/src/android/security/cts/StagefrightTest.java
+++ b/tests/tests/security/src/android/security/cts/StagefrightTest.java
@@ -416,6 +416,17 @@ public class StagefrightTest extends InstrumentationTestCase {
doStagefrightTest(R.raw.bug_35467107);
}
+ /***********************************************************
+ to prevent merge conflicts, add O tests below this comment,
+ before any existing test methods
+ ***********************************************************/
+
+ @SecurityTest
+ public void testBug_67737022() throws Exception {
+ doStagefrightTest(R.raw.bug_67737022);
+ }
+
+
private void doStagefrightTest(final int rid) throws Exception {
doStagefrightTestMediaPlayer(rid);
doStagefrightTestMediaCodec(rid);