summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-prod (mdb) <android-build-team-robot@google.com>2019-10-24 23:08:20 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-10-24 23:08:20 +0000
commite8462c21d6d3f9bf8b35b9046504b2a207c6f828 (patch)
treecc9f542d60026ed60e41076c4dca97888aff2f72
parent40d2075f4164ba881e9bb78532f93a6bf40af91f (diff)
parent8c5e5ad997b5be8eca8eb3b690a2471af21acb02 (diff)
downloadplatform_cts-android-vts-8.0_r13.tar.gz
platform_cts-android-vts-8.0_r13.tar.bz2
platform_cts-android-vts-8.0_r13.zip
Merge "Snap for 5961935 from 01d8d29fe4791f655512d502552daeb84a3f1849 to oreo-vts-release" into oreo-vts-releaseandroid-vts-8.0_r13
-rw-r--r--apps/CtsVerifier/AndroidManifest.xml2
-rw-r--r--tests/tests/media/src/android/media/cts/MediaMuxerTest.java14
-rw-r--r--tests/tests/media/src/android/media/cts/MediaRecorderTest.java14
-rw-r--r--tests/tests/text/src/android/text/format/cts/TimeTest.java7
-rw-r--r--tests/tests/webkit/src/android/webkit/cts/ServiceWorkerClientTest.java28
-rw-r--r--tools/cts-tradefed/Android.mk2
-rw-r--r--tools/cts-tradefed/res/config/cts-known-failures.xml3
7 files changed, 55 insertions, 15 deletions
diff --git a/apps/CtsVerifier/AndroidManifest.xml b/apps/CtsVerifier/AndroidManifest.xml
index 6e7f8a6fa40..a63dc485b0c 100644
--- a/apps/CtsVerifier/AndroidManifest.xml
+++ b/apps/CtsVerifier/AndroidManifest.xml
@@ -18,7 +18,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.cts.verifier"
android:versionCode="5"
- android:versionName="8.0_r21">
+ android:versionName="8.0_r22">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="26"/>
diff --git a/tests/tests/media/src/android/media/cts/MediaMuxerTest.java b/tests/tests/media/src/android/media/cts/MediaMuxerTest.java
index 15d08a34fd0..fa0914968e5 100644
--- a/tests/tests/media/src/android/media/cts/MediaMuxerTest.java
+++ b/tests/tests/media/src/android/media/cts/MediaMuxerTest.java
@@ -480,6 +480,12 @@ public class MediaMuxerTest extends AndroidTestCase {
// parsing String location and recover the location information in floats
// Make sure the tolerance is very small - due to rounding errors.
+ // Trim the trailing slash, if any.
+ int lastIndex = location.lastIndexOf('/');
+ if (lastIndex != -1) {
+ location = location.substring(0, lastIndex);
+ }
+
// Get the position of the -/+ sign in location String, which indicates
// the beginning of the longitude.
int minusIndex = location.lastIndexOf('-');
@@ -489,12 +495,8 @@ public class MediaMuxerTest extends AndroidTestCase {
(minusIndex > 0 || plusIndex > 0));
int index = Math.max(minusIndex, plusIndex);
- float latitude = Float.parseFloat(location.substring(0, index - 1));
- int lastIndex = location.lastIndexOf('/', index);
- if (lastIndex == -1) {
- lastIndex = location.length();
- }
- float longitude = Float.parseFloat(location.substring(index, lastIndex - 1));
+ float latitude = Float.parseFloat(location.substring(0, index));
+ float longitude = Float.parseFloat(location.substring(index));
assertTrue("Incorrect latitude: " + latitude + " [" + location + "]",
Math.abs(latitude - LATITUDE) <= TOLERANCE);
assertTrue("Incorrect longitude: " + longitude + " [" + location + "]",
diff --git a/tests/tests/media/src/android/media/cts/MediaRecorderTest.java b/tests/tests/media/src/android/media/cts/MediaRecorderTest.java
index 6313621765b..ca89e1b2812 100644
--- a/tests/tests/media/src/android/media/cts/MediaRecorderTest.java
+++ b/tests/tests/media/src/android/media/cts/MediaRecorderTest.java
@@ -507,6 +507,12 @@ public class MediaRecorderTest extends ActivityInstrumentationTestCase2<MediaStu
// Make sure the tolerance is very small - due to rounding errors?.
Log.v(TAG, "location: " + location);
+ // Trim the trailing slash, if any.
+ int lastIndex = location.lastIndexOf('/');
+ if (lastIndex != -1) {
+ location = location.substring(0, lastIndex);
+ }
+
// Get the position of the -/+ sign in location String, which indicates
// the beginning of the longtitude.
int index = location.lastIndexOf('-');
@@ -515,12 +521,8 @@ public class MediaRecorderTest extends ActivityInstrumentationTestCase2<MediaStu
}
assertTrue("+ or - is not found", index != -1);
assertTrue("+ or - is only found at the beginning", index != 0);
- float latitude = Float.parseFloat(location.substring(0, index - 1));
- int lastIndex = location.lastIndexOf('/', index);
- if (lastIndex == -1) {
- lastIndex = location.length();
- }
- float longitude = Float.parseFloat(location.substring(index, lastIndex - 1));
+ float latitude = Float.parseFloat(location.substring(0, index));
+ float longitude = Float.parseFloat(location.substring(index));
assertTrue("Incorrect latitude: " + latitude, Math.abs(latitude - LATITUDE) <= TOLERANCE);
assertTrue("Incorrect longitude: " + longitude, Math.abs(longitude - LONGITUDE) <= TOLERANCE);
retriever.release();
diff --git a/tests/tests/text/src/android/text/format/cts/TimeTest.java b/tests/tests/text/src/android/text/format/cts/TimeTest.java
index f43ad122085..df93f349e01 100644
--- a/tests/tests/text/src/android/text/format/cts/TimeTest.java
+++ b/tests/tests/text/src/android/text/format/cts/TimeTest.java
@@ -2825,6 +2825,13 @@ public class TimeTest {
Fields.verifyTimeEquals(expected, t);
}
+ @Test
+ public void test_bug118835133() {
+ Time t = new Time("Asia/Singapore");
+ Fields.set(t, 2018, 9, 30, 12, 48, 32, 0 /* isDst */, 0, 0, 0);
+ // With http://b/118835133 toMillis() returns -1.
+ assertEquals(1540874912000L, t.toMillis(true /* ignoreDst */));
+ }
private static void verifyNormalizeResult(boolean normalizeArgument, Time toNormalize,
Time expectedTime, long expectedTimeMillis) {
long actualTimeMillis = toNormalize.normalize(normalizeArgument /* ignore isDst */);
diff --git a/tests/tests/webkit/src/android/webkit/cts/ServiceWorkerClientTest.java b/tests/tests/webkit/src/android/webkit/cts/ServiceWorkerClientTest.java
index 1e9f5e8ef13..ac736cfa7c9 100644
--- a/tests/tests/webkit/src/android/webkit/cts/ServiceWorkerClientTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/ServiceWorkerClientTest.java
@@ -57,13 +57,22 @@ public class ServiceWorkerClientTest extends ActivityInstrumentationTestCase2<We
+ " <script>\n"
+ " navigator.serviceWorker.register('sw.js').then(function(reg) {\n"
+ " " + JS_INTERFACE_NAME + ".registrationSuccess();\n"
- + " }).catch(function(err) { \n"
+ + " }).catch(function(err) {\n"
+ " console.error(err);\n"
+ " });\n"
+ " </script>\n"
+ " </body>\n"
+ "</html>\n";
private static final String SW_RAW_HTML = "fetch('fetch.html');";
+ private static final String SW_UNREGISTER_RAW_JS =
+ "navigator.serviceWorker.getRegistration().then(function(r) {"
+ + " r.unregister().then(function(success) {"
+ + " if (success) " + JS_INTERFACE_NAME + ".unregisterSuccess();"
+ + " else console.error('unregister() was not successful');"
+ + " });"
+ + "}).catch(function(err) {"
+ + " console.error(err);"
+ + "});";
private JavascriptStatusReceiver mJavascriptStatusReceiver;
private WebViewOnUiThread mOnUiThread;
@@ -171,17 +180,34 @@ public class ServiceWorkerClientTest extends ActivityInstrumentationTestCase2<We
assertEquals(2, requests.size());
assertEquals(SW_URL, requests.get(0).getUrl().toString());
assertEquals(FETCH_URL, requests.get(1).getUrl().toString());
+
+ // Clean-up, make sure to unregister the Service Worker.
+ mOnUiThread.evaluateJavascript(SW_UNREGISTER_RAW_JS, null);
+ Callable<Boolean> unregisterSuccess = new Callable<Boolean>() {
+ @Override
+ public Boolean call() {
+ return mJavascriptStatusReceiver.mUnregisterSuccess;
+ }
+ };
+ PollingCheck.check("JS could not unregister Service Worker", POLLING_TIMEOUT,
+ unregisterSuccess);
}
// Object added to the page via AddJavascriptInterface() that is used by the test Javascript to
// notify back to Java if the Service Worker registration was successful.
public final static class JavascriptStatusReceiver {
public volatile boolean mRegistrationSuccess = false;
+ public volatile boolean mUnregisterSuccess = false;
@JavascriptInterface
public void registrationSuccess() {
mRegistrationSuccess = true;
}
+
+ @JavascriptInterface
+ public void unregisterSuccess() {
+ mUnregisterSuccess = true;
+ }
}
}
diff --git a/tools/cts-tradefed/Android.mk b/tools/cts-tradefed/Android.mk
index 54b8f709470..b782090758e 100644
--- a/tools/cts-tradefed/Android.mk
+++ b/tools/cts-tradefed/Android.mk
@@ -25,7 +25,7 @@ LOCAL_SUITE_BUILD_NUMBER := $(BUILD_NUMBER_FROM_FILE)
LOCAL_SUITE_TARGET_ARCH := $(TARGET_ARCH)
LOCAL_SUITE_NAME := CTS
LOCAL_SUITE_FULLNAME := "Compatibility Test Suite"
-LOCAL_SUITE_VERSION := 8.0_r21
+LOCAL_SUITE_VERSION := 8.0_r22
LOCAL_MODULE := cts-tradefed
LOCAL_COMPATIBILITY_SUITE := general-tests
diff --git a/tools/cts-tradefed/res/config/cts-known-failures.xml b/tools/cts-tradefed/res/config/cts-known-failures.xml
index 48d1e8bc05b..40cff00c975 100644
--- a/tools/cts-tradefed/res/config/cts-known-failures.xml
+++ b/tools/cts-tradefed/res/config/cts-known-failures.xml
@@ -282,4 +282,7 @@
<!-- b/69277153 -->
<option name="compatibility:exclude-filter" value="CtsSecurityHostTestCases android.security.cts.SELinuxHostTest#testNoExemptionsForSocketsBetweenCoreAndVendorBan" />
+
+ <!-- b/121116786 -->
+ <option name="compatibility:exclude-filter" value="CtsAppSecurityHostTestCases android.appsecurity.cts.AppSecurityTests#testPermissionDiffCert" />
</configuration>