File tree Expand file tree Collapse file tree
app/src/androidTest/java/org/schabi/newpipe/ui/components/menu Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org.schabi.newpipe.ui.components.menu
22
3+ import android.os.Build
34import androidx.activity.ComponentActivity
45import androidx.compose.runtime.getValue
56import androidx.compose.runtime.mutableStateOf
@@ -44,6 +45,8 @@ import org.junit.Assert.assertEquals
4445import org.junit.Assert.assertNotEquals
4546import org.junit.Rule
4647import org.junit.Test
48+ import org.junit.rules.RuleChain
49+ import org.junit.rules.TestRule
4750import org.junit.runner.RunWith
4851import org.schabi.newpipe.R
4952import org.schabi.newpipe.assertInRange
@@ -69,7 +72,12 @@ class LongPressMenuTest {
6972 // Test rule for restoring device to its starting display size when a test case finishes.
7073 // See https://developer.android.com/training/testing/different-screens/tools#resize-displays.
7174 @get:Rule(order = 2 )
72- val displaySizeRule: DisplaySizeRule = DisplaySizeRule ()
75+ val displaySizeRule: TestRule =
76+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .N ) {
77+ DisplaySizeRule ()
78+ } else {
79+ RuleChain .emptyRuleChain()
80+ }
7381
7482 private fun getLongPressable (
7583 title : String = "title",
You can’t perform that action at this time.
0 commit comments