detox 20.20.3 → 20.22.0-smoke.0
Sign up to get free protection for your applications and to get access to all the features.
- package/Detox-android/com/wix/detox/{20.20.3/detox-20.20.3-sources.jar → 20.22.0-smoke.0/detox-20.22.0-smoke.0-sources.jar} +0 -0
- package/Detox-android/com/wix/detox/20.22.0-smoke.0/detox-20.22.0-smoke.0-sources.jar.md5 +1 -0
- package/Detox-android/com/wix/detox/20.22.0-smoke.0/detox-20.22.0-smoke.0-sources.jar.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.22.0-smoke.0/detox-20.22.0-smoke.0-sources.jar.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.22.0-smoke.0/detox-20.22.0-smoke.0-sources.jar.sha512 +1 -0
- package/Detox-android/com/wix/detox/20.22.0-smoke.0/detox-20.22.0-smoke.0.aar +0 -0
- package/Detox-android/com/wix/detox/20.22.0-smoke.0/detox-20.22.0-smoke.0.aar.md5 +1 -0
- package/Detox-android/com/wix/detox/20.22.0-smoke.0/detox-20.22.0-smoke.0.aar.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.22.0-smoke.0/detox-20.22.0-smoke.0.aar.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.22.0-smoke.0/detox-20.22.0-smoke.0.aar.sha512 +1 -0
- package/Detox-android/com/wix/detox/{20.20.3/detox-20.20.3.pom → 20.22.0-smoke.0/detox-20.22.0-smoke.0.pom} +1 -1
- package/Detox-android/com/wix/detox/20.22.0-smoke.0/detox-20.22.0-smoke.0.pom.md5 +1 -0
- package/Detox-android/com/wix/detox/20.22.0-smoke.0/detox-20.22.0-smoke.0.pom.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.22.0-smoke.0/detox-20.22.0-smoke.0.pom.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.22.0-smoke.0/detox-20.22.0-smoke.0.pom.sha512 +1 -0
- package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
- package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
- package/Detox-android/com/wix/detox-legacy/{20.20.3/detox-legacy-20.20.3-sources.jar → 20.22.0-smoke.0/detox-legacy-20.22.0-smoke.0-sources.jar} +0 -0
- package/Detox-android/com/wix/detox-legacy/20.22.0-smoke.0/detox-legacy-20.22.0-smoke.0-sources.jar.md5 +1 -0
- package/Detox-android/com/wix/detox-legacy/20.22.0-smoke.0/detox-legacy-20.22.0-smoke.0-sources.jar.sha1 +1 -0
- package/Detox-android/com/wix/detox-legacy/20.22.0-smoke.0/detox-legacy-20.22.0-smoke.0-sources.jar.sha256 +1 -0
- package/Detox-android/com/wix/detox-legacy/20.22.0-smoke.0/detox-legacy-20.22.0-smoke.0-sources.jar.sha512 +1 -0
- package/Detox-android/com/wix/detox-legacy/20.22.0-smoke.0/detox-legacy-20.22.0-smoke.0.aar +0 -0
- package/Detox-android/com/wix/detox-legacy/20.22.0-smoke.0/detox-legacy-20.22.0-smoke.0.aar.md5 +1 -0
- package/Detox-android/com/wix/detox-legacy/20.22.0-smoke.0/detox-legacy-20.22.0-smoke.0.aar.sha1 +1 -0
- package/Detox-android/com/wix/detox-legacy/20.22.0-smoke.0/detox-legacy-20.22.0-smoke.0.aar.sha256 +1 -0
- package/Detox-android/com/wix/detox-legacy/20.22.0-smoke.0/detox-legacy-20.22.0-smoke.0.aar.sha512 +1 -0
- package/Detox-android/com/wix/detox-legacy/{20.20.3/detox-legacy-20.20.3.pom → 20.22.0-smoke.0/detox-legacy-20.22.0-smoke.0.pom} +1 -1
- package/Detox-android/com/wix/detox-legacy/20.22.0-smoke.0/detox-legacy-20.22.0-smoke.0.pom.md5 +1 -0
- package/Detox-android/com/wix/detox-legacy/20.22.0-smoke.0/detox-legacy-20.22.0-smoke.0.pom.sha1 +1 -0
- package/Detox-android/com/wix/detox-legacy/20.22.0-smoke.0/detox-legacy-20.22.0-smoke.0.pom.sha256 +1 -0
- package/Detox-android/com/wix/detox-legacy/20.22.0-smoke.0/detox-legacy-20.22.0-smoke.0.pom.sha512 +1 -0
- package/Detox-android/com/wix/detox-legacy/maven-metadata.xml +4 -4
- package/Detox-android/com/wix/detox-legacy/maven-metadata.xml.md5 +1 -1
- package/Detox-android/com/wix/detox-legacy/maven-metadata.xml.sha1 +1 -1
- package/Detox-android/com/wix/detox-legacy/maven-metadata.xml.sha256 +1 -1
- package/Detox-android/com/wix/detox-legacy/maven-metadata.xml.sha512 +1 -1
- package/Detox-ios-src.tbz +0 -0
- package/Detox-ios.tbz +0 -0
- package/android/detox/src/coreNative/java/com/wix/detox/actions/DetoxViewActions.kt +2 -2
- package/android/detox/src/full/java/com/wix/detox/espresso/DetoxAction.java +39 -15
- package/android/detox/src/full/java/com/wix/detox/espresso/action/RNClickAction.java +13 -11
- package/android/detox/src/main/java/com/wix/detox/espresso/action/{DetoxMultiTap.kt → DetoxCustomTapper.kt} +8 -6
- package/android/detox/src/main/java/com/wix/detox/espresso/action/DetoxSingleTap.kt +1 -1
- package/android/detox/src/main/java/com/wix/detox/espresso/action/common/DetoxViewConfiguration.kt +10 -0
- package/android/detox/src/main/java/com/wix/detox/espresso/action/common/TapEvents.kt +12 -4
- package/android/detox/src/main/java/com/wix/detox/espresso/scroll/DetoxScrollActions.kt +3 -1
- package/android/detox/src/main/java/com/wix/detox/espresso/scroll/DetoxSwipe.kt +1 -1
- package/android/detox/src/main/java/com/wix/detox/espresso/scroll/ScrollHelper.java +2 -2
- package/android/detox/src/testFull/java/com/wix/detox/common/TapEventsSpec.kt +15 -3
- package/android/detox/src/testFull/java/com/wix/detox/espresso/action/{DetoxMultiTapSpec.kt → DetoxCustomTapperSpec.kt} +21 -11
- package/detox.d.ts +36 -22
- package/jest.config.js +1 -1
- package/package.json +3 -3
- package/src/android/actions/native.js +4 -2
- package/src/android/core/NativeElement.js +6 -3
- package/src/android/espressoapi/DetoxAction.js +105 -0
- package/src/client/Client.js +4 -0
- package/src/client/actions/actions.js +19 -0
- package/src/devices/runtime/RuntimeDevice.js +5 -0
- package/src/devices/runtime/drivers/DeviceDriverBase.js +4 -0
- package/src/devices/runtime/drivers/ios/SimulatorDriver.js +11 -0
- package/src/ios/expectTwo.js +23 -12
- package/src/utils/assertArgument.js +28 -0
- package/src/utils/invocationTraceDescriptions.js +1 -1
- package/src/utils/mapLongPressArguments.js +32 -0
- package/Detox-android/com/wix/detox/20.20.3/detox-20.20.3-sources.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/20.20.3/detox-20.20.3-sources.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/20.20.3/detox-20.20.3-sources.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/20.20.3/detox-20.20.3-sources.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/20.20.3/detox-20.20.3.aar +0 -0
- package/Detox-android/com/wix/detox/20.20.3/detox-20.20.3.aar.md5 +0 -1
- package/Detox-android/com/wix/detox/20.20.3/detox-20.20.3.aar.sha1 +0 -1
- package/Detox-android/com/wix/detox/20.20.3/detox-20.20.3.aar.sha256 +0 -1
- package/Detox-android/com/wix/detox/20.20.3/detox-20.20.3.aar.sha512 +0 -1
- package/Detox-android/com/wix/detox/20.20.3/detox-20.20.3.pom.md5 +0 -1
- package/Detox-android/com/wix/detox/20.20.3/detox-20.20.3.pom.sha1 +0 -1
- package/Detox-android/com/wix/detox/20.20.3/detox-20.20.3.pom.sha256 +0 -1
- package/Detox-android/com/wix/detox/20.20.3/detox-20.20.3.pom.sha512 +0 -1
- package/Detox-android/com/wix/detox-legacy/20.20.3/detox-legacy-20.20.3-sources.jar.md5 +0 -1
- package/Detox-android/com/wix/detox-legacy/20.20.3/detox-legacy-20.20.3-sources.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox-legacy/20.20.3/detox-legacy-20.20.3-sources.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox-legacy/20.20.3/detox-legacy-20.20.3-sources.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox-legacy/20.20.3/detox-legacy-20.20.3.aar +0 -0
- package/Detox-android/com/wix/detox-legacy/20.20.3/detox-legacy-20.20.3.aar.md5 +0 -1
- package/Detox-android/com/wix/detox-legacy/20.20.3/detox-legacy-20.20.3.aar.sha1 +0 -1
- package/Detox-android/com/wix/detox-legacy/20.20.3/detox-legacy-20.20.3.aar.sha256 +0 -1
- package/Detox-android/com/wix/detox-legacy/20.20.3/detox-legacy-20.20.3.aar.sha512 +0 -1
- package/Detox-android/com/wix/detox-legacy/20.20.3/detox-legacy-20.20.3.pom.md5 +0 -1
- package/Detox-android/com/wix/detox-legacy/20.20.3/detox-legacy-20.20.3.pom.sha1 +0 -1
- package/Detox-android/com/wix/detox-legacy/20.20.3/detox-legacy-20.20.3.pom.sha256 +0 -1
- package/Detox-android/com/wix/detox-legacy/20.20.3/detox-legacy-20.20.3.pom.sha512 +0 -1
- package/android/detox/src/main/java/com/wix/detox/espresso/scroll/FlinglessSwiper.kt +0 -50
- package/android/detox/src/testFull/java/com/wix/detox/espresso/scroll/FlinglessSwiperSpec.kt +0 -237
@@ -1,50 +0,0 @@
|
|
1
|
-
package com.wix.detox.espresso.scroll
|
2
|
-
|
3
|
-
import android.view.ViewConfiguration
|
4
|
-
import androidx.test.espresso.UiController
|
5
|
-
import com.wix.detox.espresso.action.common.MotionEvents
|
6
|
-
|
7
|
-
/**
|
8
|
-
* A detox-swiper that, given the total expected motions, tries to swipe fast and yet avoid an
|
9
|
-
* undesired fling, typically triggered at the end of a swipe motion over scrollable views. It mostly
|
10
|
-
* relies on [ViewConfiguration.getScaledMinimumFlingVelocity] (i.e. tries to keep swiping below
|
11
|
-
* that velocity, at least at the end).
|
12
|
-
*
|
13
|
-
* @see DetoxSwipe
|
14
|
-
*/
|
15
|
-
class FlinglessSwiper @JvmOverloads constructor(
|
16
|
-
expectedMotions: Int,
|
17
|
-
uiController: UiController,
|
18
|
-
viewConfig: ViewConfiguration,
|
19
|
-
motionEvents: MotionEvents = MotionEvents())
|
20
|
-
: DetoxSwiper(uiController, motionEvents) {
|
21
|
-
|
22
|
-
private val pixelsPerSecond = viewConfig.scaledMinimumFlingVelocity * VELOCITY_SAFETY_RATIO
|
23
|
-
private val fastEventsCountLimit = expectedMotions * FAST_EVENTS_RATIO
|
24
|
-
|
25
|
-
override fun calcEventTime(targetX: Float, targetY: Float): Long {
|
26
|
-
val lastEvent = events.last()
|
27
|
-
var dt = 10
|
28
|
-
|
29
|
-
val motionsCount = events.size
|
30
|
-
|
31
|
-
if (motionsCount >= fastEventsCountLimit) {
|
32
|
-
val dx = Math.abs((targetX - lastEvent.x))
|
33
|
-
val dy = Math.abs((targetY - lastEvent.y))
|
34
|
-
|
35
|
-
val dtX = ((dx / pixelsPerSecond) * 1000).toInt()
|
36
|
-
val dtY = ((dy / pixelsPerSecond) * 1000).toInt()
|
37
|
-
|
38
|
-
dt = Math.max(dtX, dtY)
|
39
|
-
}
|
40
|
-
|
41
|
-
return lastEvent.eventTime + Math.max(dt, 10)
|
42
|
-
}
|
43
|
-
|
44
|
-
|
45
|
-
companion object {
|
46
|
-
// private const val LOG_TAG = "DetoxBatchedSwiper"
|
47
|
-
private const val VELOCITY_SAFETY_RATIO = .99f
|
48
|
-
private const val FAST_EVENTS_RATIO = .75f
|
49
|
-
}
|
50
|
-
}
|
package/android/detox/src/testFull/java/com/wix/detox/espresso/scroll/FlinglessSwiperSpec.kt
DELETED
@@ -1,237 +0,0 @@
|
|
1
|
-
package com.wix.detox.espresso.scroll
|
2
|
-
|
3
|
-
import android.view.MotionEvent
|
4
|
-
import android.view.ViewConfiguration
|
5
|
-
import androidx.test.espresso.UiController
|
6
|
-
import com.wix.detox.espresso.action.common.MotionEvents
|
7
|
-
import org.assertj.core.api.Assertions.assertThat
|
8
|
-
import org.mockito.kotlin.*
|
9
|
-
import org.spekframework.spek2.Spek
|
10
|
-
import org.spekframework.spek2.style.specification.describe
|
11
|
-
|
12
|
-
object FlinglessSwiperSpec: Spek({
|
13
|
-
describe("Flingless Swiper") {
|
14
|
-
val swipeStartTime = 1000L
|
15
|
-
|
16
|
-
lateinit var uiController: UiController
|
17
|
-
lateinit var downEvent: MotionEvent
|
18
|
-
lateinit var moveEvent: MotionEvent
|
19
|
-
lateinit var upEvent: MotionEvent
|
20
|
-
lateinit var motionEvents: MotionEvents
|
21
|
-
lateinit var viewConfig: ViewConfiguration
|
22
|
-
|
23
|
-
beforeEachTest {
|
24
|
-
uiController = mock()
|
25
|
-
downEvent = mock(name = "downEventMock") {
|
26
|
-
on { downTime }.doReturn(swipeStartTime)
|
27
|
-
on { eventTime }.doReturn(swipeStartTime)
|
28
|
-
}
|
29
|
-
moveEvent = mock(name = "moveEventMock") {
|
30
|
-
on { downTime }.doReturn(swipeStartTime)
|
31
|
-
on { eventTime }.doReturn(swipeStartTime)
|
32
|
-
}
|
33
|
-
upEvent = mock(name = "upEventMock") {
|
34
|
-
on { downTime }.doReturn(swipeStartTime)
|
35
|
-
on { eventTime }.doReturn(swipeStartTime)
|
36
|
-
}
|
37
|
-
motionEvents = mock(name = "motionEventsMock") {
|
38
|
-
on { obtainDownEvent(any(), any(), any()) }.doReturn(downEvent)
|
39
|
-
on { obtainMoveEvent(any(), any(), any(), any()) }.doReturn(moveEvent)
|
40
|
-
on { obtainUpEvent(any(), any(), any(), any()) }.doReturn(upEvent)
|
41
|
-
}
|
42
|
-
viewConfig = mock()
|
43
|
-
}
|
44
|
-
|
45
|
-
fun uut(expectedMotions: Int = -1) = FlinglessSwiper(expectedMotions, uiController, viewConfig, motionEvents)
|
46
|
-
|
47
|
-
describe("start") {
|
48
|
-
it("should obtain a down event") {
|
49
|
-
uut().startAt(666f, 999f)
|
50
|
-
verify(motionEvents).obtainDownEvent(eq(666f), eq(999f), any())
|
51
|
-
}
|
52
|
-
|
53
|
-
it("should throw a descriptive error if already started") {
|
54
|
-
var err: Exception? = null
|
55
|
-
try {
|
56
|
-
with (uut()) {
|
57
|
-
startAt(666f, 999f)
|
58
|
-
startAt(667f, 998f)
|
59
|
-
}
|
60
|
-
} catch (e: Exception) {
|
61
|
-
err = e
|
62
|
-
}
|
63
|
-
assertThat(err).isNotNull()
|
64
|
-
assertThat(err).hasMessage("Swiper already started")
|
65
|
-
}
|
66
|
-
}
|
67
|
-
|
68
|
-
describe("move") {
|
69
|
-
val SWIPER_VELOCITY = 99f
|
70
|
-
|
71
|
-
beforeEachTest {
|
72
|
-
whenever(viewConfig.scaledMinimumFlingVelocity).doReturn(100) // i.e. we expect the swiper to apply a safety margin of 99%, hence actual velocity = 99 px/sec
|
73
|
-
}
|
74
|
-
|
75
|
-
it("should obtain a move event") {
|
76
|
-
with(uut()) {
|
77
|
-
startAt(666f, 999f)
|
78
|
-
moveTo(111f, 222f)
|
79
|
-
}
|
80
|
-
verify(motionEvents).obtainMoveEvent(eq(downEvent), any(), eq(111f), eq(222f))
|
81
|
-
}
|
82
|
-
|
83
|
-
it("should throw descriptive error if moved before starting") {
|
84
|
-
var err: Exception? = null
|
85
|
-
try {
|
86
|
-
uut().moveTo(111f, 222f)
|
87
|
-
} catch (e: Exception) {
|
88
|
-
err = e
|
89
|
-
}
|
90
|
-
assertThat(err).isNotNull()
|
91
|
-
assertThat(err).hasMessage("Swiper not initialized - did you forget to call startAt()?")
|
92
|
-
}
|
93
|
-
|
94
|
-
describe("event time") {
|
95
|
-
it("should set event time according to min fling speed config (1 second if distance=velocity)") {
|
96
|
-
val expectedEventTime = swipeStartTime + 1000L
|
97
|
-
|
98
|
-
with(uut()) {
|
99
|
-
startAt(0f, 0f)
|
100
|
-
moveTo(0f, SWIPER_VELOCITY)
|
101
|
-
}
|
102
|
-
|
103
|
-
verify(motionEvents).obtainMoveEvent(any(), eq(expectedEventTime), any(), any())
|
104
|
-
}
|
105
|
-
|
106
|
-
it("should set event time according to negative scroll direction") {
|
107
|
-
whenever(downEvent.y).doReturn(SWIPER_VELOCITY)
|
108
|
-
|
109
|
-
val expectedEventTime = swipeStartTime + 1000L
|
110
|
-
|
111
|
-
with(uut()) {
|
112
|
-
startAt(0f, SWIPER_VELOCITY)
|
113
|
-
moveTo(0f, 0f)
|
114
|
-
}
|
115
|
-
|
116
|
-
verify(motionEvents).obtainMoveEvent(any(), eq(expectedEventTime), any(), any())
|
117
|
-
}
|
118
|
-
|
119
|
-
it("should set event time proportional to min fling speed config (half the distance => half the time)") {
|
120
|
-
val expectedEventTime = swipeStartTime + 500L
|
121
|
-
|
122
|
-
with(uut()) {
|
123
|
-
startAt(0f, 0f)
|
124
|
-
moveTo(0f, SWIPER_VELOCITY/2)
|
125
|
-
}
|
126
|
-
|
127
|
-
verify(motionEvents).obtainMoveEvent(any(), eq(expectedEventTime), any(), any())
|
128
|
-
}
|
129
|
-
|
130
|
-
it("should apply a min event-time delta of 10ms") {
|
131
|
-
val expectedMinDelta = 10
|
132
|
-
val expectedEventTime = swipeStartTime + expectedMinDelta
|
133
|
-
|
134
|
-
with(uut()) {
|
135
|
-
startAt(0f, 0f)
|
136
|
-
moveTo(0f, .765f) // i.e. raw result is 9ms, but it won't be used
|
137
|
-
}
|
138
|
-
|
139
|
-
verify(motionEvents).obtainMoveEvent(any(), eq(expectedEventTime), any(), any())
|
140
|
-
}
|
141
|
-
|
142
|
-
it("should take x-axis movement into account in event time calcs") {
|
143
|
-
val expectedEventTime = swipeStartTime + 1000L
|
144
|
-
|
145
|
-
with(uut()) {
|
146
|
-
startAt(0f, 0f)
|
147
|
-
moveTo(SWIPER_VELOCITY, 0f)
|
148
|
-
}
|
149
|
-
|
150
|
-
verify(motionEvents).obtainMoveEvent(any(), eq(expectedEventTime), any(), any())
|
151
|
-
}
|
152
|
-
|
153
|
-
it("should optimize by applying fling-speed limitation only in last 25% of events") {
|
154
|
-
whenever(moveEvent.y).doReturn(255f)
|
155
|
-
|
156
|
-
with(uut(expectedMotions = 4)) {
|
157
|
-
startAt(0f, 0f)
|
158
|
-
moveTo(0f, 85f)
|
159
|
-
moveTo(0f, 170f)
|
160
|
-
moveTo(0f, 255f)
|
161
|
-
moveTo(0f, 340f)
|
162
|
-
}
|
163
|
-
|
164
|
-
verify(motionEvents, times(3)).obtainMoveEvent(any(), eq(swipeStartTime + 10L), any(), any())
|
165
|
-
verify(motionEvents, times(1)).obtainMoveEvent(any(), eq(swipeStartTime + 858), any(), any())
|
166
|
-
}
|
167
|
-
}
|
168
|
-
}
|
169
|
-
|
170
|
-
describe("finish") {
|
171
|
-
it("should throw descriptive error if not started") {
|
172
|
-
var err: Exception? = null
|
173
|
-
try {
|
174
|
-
with (uut()) {
|
175
|
-
finishAt(1f, 1f)
|
176
|
-
}
|
177
|
-
} catch (e: Exception) {
|
178
|
-
err = e
|
179
|
-
}
|
180
|
-
assertThat(err).isNotNull()
|
181
|
-
assertThat(err).hasMessage("Swiper not initialized - did you forget to call startAt()?")
|
182
|
-
}
|
183
|
-
|
184
|
-
it("should finish by obtaining an up event") {
|
185
|
-
whenever(downEvent.x).doReturn(666f)
|
186
|
-
whenever(downEvent.y).doReturn(999f)
|
187
|
-
whenever(viewConfig.scaledMinimumFlingVelocity).doReturn(100)
|
188
|
-
|
189
|
-
val expectedEventTime = swipeStartTime + 1000L
|
190
|
-
|
191
|
-
with(uut()) {
|
192
|
-
startAt(666f, 999f)
|
193
|
-
finishAt(666f + 99f, 999f + 99f)
|
194
|
-
}
|
195
|
-
verify(motionEvents).obtainUpEvent(downEvent, expectedEventTime, 666f + 99f, 999f + 99f)
|
196
|
-
}
|
197
|
-
|
198
|
-
it("should finish by flushing all events to ui controller") {
|
199
|
-
with(uut()) {
|
200
|
-
startAt(0f, 0f)
|
201
|
-
moveTo(1f, 1f)
|
202
|
-
finishAt(2f, 2f)
|
203
|
-
}
|
204
|
-
verify(uiController).injectMotionEventSequence(eq(listOf(downEvent, moveEvent, upEvent)))
|
205
|
-
}
|
206
|
-
|
207
|
-
it("should finish by recycling all events") {
|
208
|
-
with(uut()) {
|
209
|
-
startAt(0f, 0f)
|
210
|
-
moveTo(1f, 1f)
|
211
|
-
finishAt(2f, 2f)
|
212
|
-
}
|
213
|
-
|
214
|
-
verify(downEvent).recycle()
|
215
|
-
verify(upEvent).recycle()
|
216
|
-
verify(moveEvent).recycle()
|
217
|
-
}
|
218
|
-
|
219
|
-
it("should recycle all events even if ui controller fails") {
|
220
|
-
whenever(uiController.injectMotionEventSequence(any())).doThrow(RuntimeException())
|
221
|
-
|
222
|
-
with(uut()) {
|
223
|
-
startAt(0f, 0f)
|
224
|
-
moveTo(1f, 1f)
|
225
|
-
try {
|
226
|
-
finishAt(2f, 2f)
|
227
|
-
} catch (ex: Exception) {
|
228
|
-
}
|
229
|
-
}
|
230
|
-
|
231
|
-
verify(downEvent).recycle()
|
232
|
-
verify(upEvent).recycle()
|
233
|
-
verify(moveEvent).recycle()
|
234
|
-
}
|
235
|
-
}
|
236
|
-
}
|
237
|
-
})
|