diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-05-16 01:23:56 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-05-16 01:23:56 +0000 |
commit | 2e0bf24e8d1d8926f04882a448ca57693d0a1f77 (patch) | |
tree | 24b8ff8795f540c2a137c40d757002f31b1816f2 | |
parent | cb465bd9d8ed68f21c1fab63ae8a525fb4b6e4ec (diff) | |
parent | 00c5c21a2e1decceeb7ef6ac1f415de7e07c0bfe (diff) | |
download | cts-sdk-release.tar.gz |
Merge "Snap for 11847757 from 72dd517e15d22f1743d31e8d72c8c83220c56240 to sdk-release" into sdk-releasesdk-release
9 files changed, 29 insertions, 29 deletions
diff --git a/hostsidetests/mediapc/videoencodingquality/app/AndroidManifest.xml b/hostsidetests/mediapc/videoencodingquality/app/AndroidManifest.xml index a3c5336c28c..54e7d959641 100644 --- a/hostsidetests/mediapc/videoencodingquality/app/AndroidManifest.xml +++ b/hostsidetests/mediapc/videoencodingquality/app/AndroidManifest.xml @@ -37,8 +37,5 @@ <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner" android:targetPackage="android.videoencoding.app" android:label="Video encoding app for android.media" > - <meta-data - android:name="listener" - android:value="com.android.cts.runner.CtsTestRunListener" /> </instrumentation> </manifest> diff --git a/hostsidetests/statsdatom/src/android/cts/statsdatom/lib/DeviceUtils.java b/hostsidetests/statsdatom/src/android/cts/statsdatom/lib/DeviceUtils.java index 21d8ab7b3af..b73916df81f 100644 --- a/hostsidetests/statsdatom/src/android/cts/statsdatom/lib/DeviceUtils.java +++ b/hostsidetests/statsdatom/src/android/cts/statsdatom/lib/DeviceUtils.java @@ -281,13 +281,22 @@ public final class DeviceUtils { throws DeviceNotAvailableException { String uidLine = device.executeShellCommand("cmd package list packages -U --user " + userId + " " + pkgName); - String[] uidLineArr = uidLine.split(":"); - // Package uid is located at index 2. - assertThat(uidLineArr.length).isGreaterThan(2); - int appUid = Integer.parseInt(uidLineArr[2].trim()); - assertThat(appUid).isGreaterThan(10000); - return appUid; + // Split package list by lines + // Sample packages response: + // package:com.android.server.cts.device.statsd.host uid:1010033 + // package:com.android.server.cts.device.statsd uid:1010034 + final String[] lines = uidLine.split("\\R+"); + for (final String line : lines) { + if (line.startsWith("package:" + pkgName + " ")) { + final int uidIndex = line.lastIndexOf(":") + 1; + final int uid = Integer.parseInt(line.substring(uidIndex).trim()); + assertThat(uid).isGreaterThan(10_000); + return uid; + } + } + throw new Error( + String.format("Could not find installed package: %s", pkgName)); } /** diff --git a/hostsidetests/videoencodingminimum/app/AndroidManifest.xml b/hostsidetests/videoencodingminimum/app/AndroidManifest.xml index 3d252354ef4..2cc1cf8e4a8 100644 --- a/hostsidetests/videoencodingminimum/app/AndroidManifest.xml +++ b/hostsidetests/videoencodingminimum/app/AndroidManifest.xml @@ -37,8 +37,5 @@ <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner" android:targetPackage="android.videoencodingmin.app" android:label="Video encoding app for android.media" > - <meta-data - android:name="listener" - android:value="com.android.cts.runner.CtsTestRunListener" /> </instrumentation> </manifest> diff --git a/tests/core/runner-axt/src/com/android/cts/core/runner/filter/CoreTestModeFilter.java b/tests/core/runner-axt/src/com/android/cts/core/runner/filter/CoreTestModeFilter.java index b297b939f88..e827a500384 100644 --- a/tests/core/runner-axt/src/com/android/cts/core/runner/filter/CoreTestModeFilter.java +++ b/tests/core/runner-axt/src/com/android/cts/core/runner/filter/CoreTestModeFilter.java @@ -53,19 +53,19 @@ public class CoreTestModeFilter implements Predicate<Description> { */ public static Predicate<Description> createInstance(Bundle args) { String mode = args.getString(ARGUMENT_MODE); - if ("mts".equals(mode)) { - // We have to hard-coded the annotation name of NonMts because the annotation definition - // isn't built into the same apk file. - return new CoreTestModeFilter(NonMts.class); - } else if ("presubmit".equals(mode)) { - return new CoreTestModeFilter(FlakyTest.class, LargeTest.class); - } else { - // The default mode is CTS, because most libcore test suites are prefixed with "Cts". + if ("cts".equals(mode)) { // It's okay that ignoredTestsInCts.txt doesn't exist in the test .apk file, and // the created CoreExpectationFilter doesn't skip any test in this case. Set<String> expectationFile = Set.of("/skippedCtsTest.txt"); return new CoreTestModeFilter(NonCts.class) .and(CoreExpectationFilter.createInstance(expectationFile)); + } else if ("presubmit".equals(mode)) { + return new CoreTestModeFilter(FlakyTest.class, LargeTest.class); + } else { + // Use MTS mode by default because MCTS should dynamically download + // the MCTS artifacts in the same version as the ART module installed + // on the device. + return new CoreTestModeFilter(NonMts.class); } } diff --git a/tests/tests/bluetooth/AndroidTest.xml b/tests/tests/bluetooth/AndroidTest.xml index 58b6c1dc3c9..1cc985d53ac 100644 --- a/tests/tests/bluetooth/AndroidTest.xml +++ b/tests/tests/bluetooth/AndroidTest.xml @@ -27,6 +27,11 @@ <option name="test-file-name" value="CtsBluetoothTestCases.apk" /> </target_preparer> <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer"> + <option name="throw-if-cmd-fail" value="true" /> + <option name="run-command" value="setprop log.tag.bluetooth VERBOSE" /> + <!-- In order for the setprop to take effect everywhere, we need to toggle OFF Bluetooth --> + <option name="run-command" value="cmd bluetooth_manager disable" /> + <option name="run-command" value="cmd bluetooth_manager wait-for-state:STATE_OFF" /> <option name="run-command" value="cmd bluetooth_manager enable" /> <option name="run-command" value="cmd bluetooth_manager wait-for-state:STATE_ON" /> <option name="teardown-command" value="cmd bluetooth_manager disable" /> diff --git a/tests/tests/bluetooth/src/android/bluetooth/cts/HearingAidProfileTest.java b/tests/tests/bluetooth/src/android/bluetooth/cts/HearingAidProfileTest.java index 96b0c847d97..35aa5975b4b 100644 --- a/tests/tests/bluetooth/src/android/bluetooth/cts/HearingAidProfileTest.java +++ b/tests/tests/bluetooth/src/android/bluetooth/cts/HearingAidProfileTest.java @@ -78,7 +78,7 @@ public class HearingAidProfileTest { // ADAPTER_DISABLE_TIMEOUT_MS = AdapterState.BLE_STOP_TIMEOUT_DELAY + // AdapterState.BREDR_STOP_TIMEOUT_DELAY private static final int ADAPTER_DISABLE_TIMEOUT_MS = 5000; - private static final String FAKE_REMOTE_ADDRESS = "00:11:22:AA:BB:CC"; + private static final String FAKE_REMOTE_ADDRESS = "42:11:22:AA:BB:CC"; private Context mContext; private BluetoothHearingAid mService; diff --git a/tests/tests/mediacujtest/largetest/AndroidManifest.xml b/tests/tests/mediacujtest/largetest/AndroidManifest.xml index 8b2be7a6481..a58d3dd0d5e 100644 --- a/tests/tests/mediacujtest/largetest/AndroidManifest.xml +++ b/tests/tests/mediacujtest/largetest/AndroidManifest.xml @@ -40,9 +40,6 @@ android:label="Media E2E tests InstrumentationRunner" android:name="androidx.test.runner.AndroidJUnitRunner" android:targetPackage="android.media.cujlargetest.cts"> - <meta-data - android:name="listener" - android:value="com.android.cts.runner.CtsTestRunListener" /> </instrumentation> </manifest> diff --git a/tests/tests/mediacujtest/smalltest/AndroidManifest.xml b/tests/tests/mediacujtest/smalltest/AndroidManifest.xml index a748dbeb9ea..3d988702325 100644 --- a/tests/tests/mediacujtest/smalltest/AndroidManifest.xml +++ b/tests/tests/mediacujtest/smalltest/AndroidManifest.xml @@ -38,8 +38,5 @@ android:label="Media E2E tests InstrumentationRunner" android:name="androidx.test.runner.AndroidJUnitRunner" android:targetPackage="android.media.cujsmalltest.cts"> - <meta-data - android:name="listener" - android:value="com.android.cts.runner.CtsTestRunListener" /> </instrumentation> </manifest> diff --git a/tests/tests/mediaediting/AndroidManifest.xml b/tests/tests/mediaediting/AndroidManifest.xml index 789cd48a110..72e76c1a2fe 100644 --- a/tests/tests/mediaediting/AndroidManifest.xml +++ b/tests/tests/mediaediting/AndroidManifest.xml @@ -31,8 +31,6 @@ <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner" android:targetPackage="android.media.mediaediting.cts" android:label="Media editing tests InstrumentationRunner"> - <meta-data android:name="listener" - android:value="com.android.cts.runner.CtsTestRunListener"/> </instrumentation> </manifest> |