diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-05-08 07:10:51 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-05-08 07:10:51 +0000 |
commit | 41347b88f0404d773d7fa037ed2755e1ea78415b (patch) | |
tree | bd145569b168b6703a7310f477c2dba15fd39c25 | |
parent | 70a823c31f51005a93ea9f93ffefb450645e52e5 (diff) | |
parent | ff58470d3125be215634c314c2233dd19f64bae0 (diff) | |
download | platform_packages_apps_Car_Dialer-41347b88f0404d773d7fa037ed2755e1ea78415b.tar.gz platform_packages_apps_Car_Dialer-41347b88f0404d773d7fa037ed2755e1ea78415b.tar.bz2 platform_packages_apps_Car_Dialer-41347b88f0404d773d7fa037ed2755e1ea78415b.zip |
Snap for 6474498 from ff58470d3125be215634c314c2233dd19f64bae0 to mainline-release
Change-Id: Idf092a964288f3ae8c2b9776f8ae0b320f1d1236
-rw-r--r-- | tests/unittests/Android.bp | 16 | ||||
-rw-r--r-- | tests/unittests/AndroidManifest.xml | 30 | ||||
-rw-r--r-- | tests/unittests/readme.md | 6 | ||||
-rw-r--r-- | tests/unittests/src/com/android/car/dialer/livedata/CallStateLiveDataUnitTest.java | 36 |
4 files changed, 88 insertions, 0 deletions
diff --git a/tests/unittests/Android.bp b/tests/unittests/Android.bp new file mode 100644 index 00000000..793fc8c5 --- /dev/null +++ b/tests/unittests/Android.bp @@ -0,0 +1,16 @@ +//############################################################ +// Car Dialer unit test target. # +//############################################################ +android_test { + name: "CarDialerUnitTests", + + srcs: ["src/**/*.java"], + + java_resource_dirs: ["config"], + + static_libs: [ + "androidx.test.ext.junit", + ], + + instrumentation_for: "CarDialerAppForTesting", +} diff --git a/tests/unittests/AndroidManifest.xml b/tests/unittests/AndroidManifest.xml new file mode 100644 index 00000000..70ceaa9a --- /dev/null +++ b/tests/unittests/AndroidManifest.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ 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. + --> + +<manifest + xmlns:android="http://schemas.android.com/apk/res/android" + package="com.android.car.dialer"> + + <application android:testOnly="true" + android:debuggable="true"> + <uses-library android:name="android.test.runner" /> + </application> + + <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner" + android:targetPackage="com.android.car.dialer.tests.unittests" + android:label="Car Dialer Unit Tests" /> +</manifest> diff --git a/tests/unittests/readme.md b/tests/unittests/readme.md new file mode 100644 index 00000000..46a64608 --- /dev/null +++ b/tests/unittests/readme.md @@ -0,0 +1,6 @@ +Unit test suite for CarDialerApp using Robolectric. + +``` +$ mma +$ atest CarDialerUnitTests +```
\ No newline at end of file diff --git a/tests/unittests/src/com/android/car/dialer/livedata/CallStateLiveDataUnitTest.java b/tests/unittests/src/com/android/car/dialer/livedata/CallStateLiveDataUnitTest.java new file mode 100644 index 00000000..9488040c --- /dev/null +++ b/tests/unittests/src/com/android/car/dialer/livedata/CallStateLiveDataUnitTest.java @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package com.android.car.dialer.livedata; + +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + +@RunWith(AndroidJUnit4.class) +public class CallStateLiveDataUnitTest { + + @Before + public void setup() { + } + + @Test + public void testOnActiveRegistry() { + } +} + |