Move CaptivePortalDataTest to common test to support cts

Commit has to on top of aosp/1281921 to skip whole test in Q
device since CaptivePortalData class is introduced in R.

Result in Q will be:
[1/1] android.net.CaptivePortalDataTest#skippedClassForDevSdkMismatch: IGNORED

Bug: 152280218
Bug: 150640683
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalDataTest on
      both Q and R device
Merged-In: Iddd00e1c85abe767b1a41a1761d3266ba322dba6
Change-Id: Iddd00e1c85abe767b1a41a1761d3266ba322dba6
This commit is contained in:
Chiachang Wang
2020-04-13 09:33:03 +00:00
parent a6182bb9da
commit 3acd429ba3

View File

@@ -16,17 +16,20 @@
package android.net package android.net
import android.os.Build
import androidx.test.filters.SmallTest import androidx.test.filters.SmallTest
import androidx.test.runner.AndroidJUnit4
import com.android.testutils.assertParcelSane import com.android.testutils.assertParcelSane
import com.android.testutils.assertParcelingIsLossless import com.android.testutils.assertParcelingIsLossless
import com.android.testutils.DevSdkIgnoreRule.IgnoreUpTo
import com.android.testutils.DevSdkIgnoreRunner
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
import kotlin.test.assertEquals import kotlin.test.assertEquals
import kotlin.test.assertNotEquals import kotlin.test.assertNotEquals
@SmallTest @SmallTest
@RunWith(AndroidJUnit4::class) @RunWith(DevSdkIgnoreRunner::class)
@IgnoreUpTo(Build.VERSION_CODES.Q)
class CaptivePortalDataTest { class CaptivePortalDataTest {
private val data = CaptivePortalData.Builder() private val data = CaptivePortalData.Builder()
.setRefreshTime(123L) .setRefreshTime(123L)