diff --git a/libs/WindowManager/Jetpack/tests/unittest/Android.bp b/libs/WindowManager/Jetpack/tests/unittest/Android.bp new file mode 100644 index 0000000000000..62e8128f93623 --- /dev/null +++ b/libs/WindowManager/Jetpack/tests/unittest/Android.bp @@ -0,0 +1,52 @@ +// Copyright (C) 2022 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 { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "frameworks_base_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["frameworks_base_license"], +} + +android_test { + name: "WMJetpackUnitTests", + + srcs: [ + "**/*.java", + ], + + static_libs: [ + "androidx.window.extensions", + "junit", + "androidx.test.runner", + "androidx.test.rules", + "androidx.test.ext.junit", + "mockito-target-extended-minus-junit4", + "truth-prebuilt", + "testables", + "platform-test-annotations", + ], + + libs: [ + "android.test.mock", + "android.test.base", + "android.test.runner", + ], + + optimize: { + enabled: false, + }, +} diff --git a/libs/WindowManager/Jetpack/tests/unittest/AndroidManifest.xml b/libs/WindowManager/Jetpack/tests/unittest/AndroidManifest.xml new file mode 100644 index 0000000000000..b12b6f6f0ef11 --- /dev/null +++ b/libs/WindowManager/Jetpack/tests/unittest/AndroidManifest.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + diff --git a/libs/WindowManager/Jetpack/tests/unittest/AndroidTest.xml b/libs/WindowManager/Jetpack/tests/unittest/AndroidTest.xml new file mode 100644 index 0000000000000..56d8c33fdc09b --- /dev/null +++ b/libs/WindowManager/Jetpack/tests/unittest/AndroidTest.xml @@ -0,0 +1,31 @@ + + + + + + + diff --git a/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/WindowExtensionsTest.java b/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/WindowExtensionsTest.java new file mode 100644 index 0000000000000..b6df876e19562 --- /dev/null +++ b/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/WindowExtensionsTest.java @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2022 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 androidx.window.extensions; + +import static com.google.common.truth.Truth.assertThat; + +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.filters.SmallTest; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + +@SmallTest +@RunWith(AndroidJUnit4.class) +public class WindowExtensionsTest { + private WindowExtensions mExtensions; + + @Before + public void setUp() { + mExtensions = WindowExtensionsProvider.getWindowExtensions(); + } + + @Test + public void testGetWindowLayoutComponent() { + assertThat(mExtensions.getWindowLayoutComponent()).isNotNull(); + } + + @Test + public void testGetActivityEmbeddingComponent() { + assertThat(mExtensions.getActivityEmbeddingComponent()).isNotNull(); + } +}