Files
media/common_library_config.gradle
ibaker 813cf73f6d Set Robolectric graphics mode to NATIVE for all tests
This avoids needing to manually add `@GraphicsMode(NATIVE)` manually
to every test that relies on graphics/bitmap decoding behaviour.

PiperOrigin-RevId: 841719886
(cherry picked from commit 2e5e56f2af)
2026-01-22 15:35:14 +00:00

60 lines
2.1 KiB
Groovy

// Copyright (C) 2020 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.
apply from: "$gradle.ext.androidxMediaSettingsDir/constants.gradle"
apply plugin: 'com.android.library'
group = 'androidx.media3'
android {
compileSdkVersion project.ext.compileSdkVersion
defaultConfig {
minSdkVersion project.ext.minSdkVersion
targetSdkVersion project.ext.targetSdkVersion
consumerProguardFiles 'proguard-rules.txt'
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
aarMetadata {
minCompileSdk = project.ext.compileSdkVersion
}
// This requires the ANDROIDX_TEST_ORCHESTRATOR and
// androidx.test:orchestrator config below.
// See https://developer.android.com/training/testing/instrumented-tests/androidx-test-libraries/runner
testInstrumentationRunnerArguments clearPackageData: 'true'
}
lintOptions {
checkTestSources true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
testOptions {
unitTests.all {
jvmArgs "-Xmx2g"
systemProperty "robolectric.graphicsMode", "NATIVE"
}
unitTests.includeAndroidResources true
// See https://developer.android.com/training/testing/instrumented-tests/androidx-test-libraries/runner
execution 'ANDROIDX_TEST_ORCHESTRATOR'
}
}
dependencies {
// See https://developer.android.com/training/testing/instrumented-tests/androidx-test-libraries/runner
androidTestUtil 'androidx.test:orchestrator:1.6.1'
}