diff --git a/tests/src/com/android/launcher3/UtilitiesKtTest.kt b/tests/multivalentTests/src/com/android/launcher3/UtilitiesKtTest.kt similarity index 87% rename from tests/src/com/android/launcher3/UtilitiesKtTest.kt rename to tests/multivalentTests/src/com/android/launcher3/UtilitiesKtTest.kt index 9aa0369d51..0d13e7722d 100644 --- a/tests/src/com/android/launcher3/UtilitiesKtTest.kt +++ b/tests/multivalentTests/src/com/android/launcher3/UtilitiesKtTest.kt @@ -17,9 +17,8 @@ package com.android.launcher3 import android.content.Context -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup +import android.widget.LinearLayout +import android.widget.TextView import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import androidx.test.platform.app.InstrumentationRegistry @@ -27,28 +26,20 @@ import com.android.launcher3.UtilitiesKt.CLIP_CHILDREN_FALSE_MODIFIER import com.android.launcher3.UtilitiesKt.CLIP_TO_PADDING_FALSE_MODIFIER import com.android.launcher3.UtilitiesKt.modifyAttributesOnViewTree import com.android.launcher3.UtilitiesKt.restoreAttributesOnViewTree -import com.android.launcher3.tests.R import com.google.common.truth.Truth.assertThat -import org.junit.Before import org.junit.Test import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class UtilitiesKtTest { - val context: Context = InstrumentationRegistry.getInstrumentation().context - private lateinit var rootView: ViewGroup - private lateinit var midView: ViewGroup - private lateinit var childView: View - @Before - fun setup() { - rootView = - LayoutInflater.from(context).inflate(R.layout.utilities_test_view, null) as ViewGroup - midView = rootView.requireViewById(R.id.mid_view) - childView = rootView.requireViewById(R.id.child_view) - } + private val childView = TextView(context) + + private val midView = LinearLayout(context).apply { addView(childView) } + + private val rootView = LinearLayout(context).apply { addView(midView) } @Test fun set_clipChildren_false() { diff --git a/tests/res/layout/utilities_test_view.xml b/tests/res/layout/utilities_test_view.xml deleted file mode 100644 index dc2a51573a..0000000000 --- a/tests/res/layout/utilities_test_view.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - \ No newline at end of file