Loading tests/functional/com/android/documentsui/TrampolineActivityTest.kt +13 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,9 @@ package com.android.documentsui import android.content.Intent import android.os.Build.VERSION_CODES import android.platform.test.annotations.RequiresFlagsEnabled import android.platform.test.flag.junit.CheckFlagsRule import android.platform.test.flag.junit.DeviceFlagsValueProvider import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SdkSuppress import androidx.test.filters.SmallTest Loading @@ -24,11 +27,13 @@ import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.By import androidx.test.uiautomator.UiDevice import androidx.test.uiautomator.Until import com.android.documentsui.flags.Flags.FLAG_REDIRECT_GET_CONTENT import com.android.documentsui.picker.TrampolineActivity import java.util.regex.Pattern import org.junit.Assert.assertNotNull import org.junit.Before import org.junit.BeforeClass import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.Parameterized Loading Loading @@ -57,6 +62,7 @@ class TrampolineActivityTest() { } @RunWith(Parameterized::class) @RequiresFlagsEnabled(FLAG_REDIRECT_GET_CONTENT) class ShouldLaunchCorrectPackageTest { enum class AppType { PHOTOPICKER, Loading Loading @@ -129,6 +135,9 @@ class TrampolineActivityTest() { @Parameterized.Parameter(0) lateinit var testData: GetContentIntentData @get:Rule val checkFlagsRule: CheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule() @Before fun setUp() { val context = InstrumentationRegistry.getInstrumentation().targetContext Loading @@ -153,7 +162,11 @@ class TrampolineActivityTest() { } @RunWith(AndroidJUnit4::class) @RequiresFlagsEnabled(FLAG_REDIRECT_GET_CONTENT) class RedirectTest { @get:Rule val checkFlagsRule: CheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule() @Test fun testReferredGetContentFromPhotopickerShouldNotRedirectBack() { val context = InstrumentationRegistry.getInstrumentation().targetContext Loading Loading
tests/functional/com/android/documentsui/TrampolineActivityTest.kt +13 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,9 @@ package com.android.documentsui import android.content.Intent import android.os.Build.VERSION_CODES import android.platform.test.annotations.RequiresFlagsEnabled import android.platform.test.flag.junit.CheckFlagsRule import android.platform.test.flag.junit.DeviceFlagsValueProvider import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SdkSuppress import androidx.test.filters.SmallTest Loading @@ -24,11 +27,13 @@ import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.By import androidx.test.uiautomator.UiDevice import androidx.test.uiautomator.Until import com.android.documentsui.flags.Flags.FLAG_REDIRECT_GET_CONTENT import com.android.documentsui.picker.TrampolineActivity import java.util.regex.Pattern import org.junit.Assert.assertNotNull import org.junit.Before import org.junit.BeforeClass import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.Parameterized Loading Loading @@ -57,6 +62,7 @@ class TrampolineActivityTest() { } @RunWith(Parameterized::class) @RequiresFlagsEnabled(FLAG_REDIRECT_GET_CONTENT) class ShouldLaunchCorrectPackageTest { enum class AppType { PHOTOPICKER, Loading Loading @@ -129,6 +135,9 @@ class TrampolineActivityTest() { @Parameterized.Parameter(0) lateinit var testData: GetContentIntentData @get:Rule val checkFlagsRule: CheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule() @Before fun setUp() { val context = InstrumentationRegistry.getInstrumentation().targetContext Loading @@ -153,7 +162,11 @@ class TrampolineActivityTest() { } @RunWith(AndroidJUnit4::class) @RequiresFlagsEnabled(FLAG_REDIRECT_GET_CONTENT) class RedirectTest { @get:Rule val checkFlagsRule: CheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule() @Test fun testReferredGetContentFromPhotopickerShouldNotRedirectBack() { val context = InstrumentationRegistry.getInstrumentation().targetContext Loading