@@ -13,8 +13,10 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
13
13
* Testing libraries may expose this interface to the tests instead of [TestCoroutineDispatcher].
14
14
*/
15
15
@ExperimentalCoroutinesApi
16
- @Deprecated(" Use `TestCoroutineScheduler` to control virtual time." ,
17
- level = DeprecationLevel .WARNING )
16
+ @Deprecated(
17
+ " Use `TestCoroutineScheduler` to control virtual time." ,
18
+ level = DeprecationLevel .WARNING
19
+ )
18
20
public interface DelayController {
19
21
/* *
20
22
* Returns the current virtual clock-time as it is known to this Dispatcher.
@@ -123,20 +125,25 @@ public interface DelayController {
123
125
public fun resumeDispatcher ()
124
126
}
125
127
126
- internal interface SchedulerAsDelayController : DelayController {
128
+ internal interface SchedulerAsDelayController : DelayController {
127
129
public val scheduler: TestCoroutineScheduler
128
130
129
131
/* * @suppress */
130
- @Deprecated(" This property delegates to the test scheduler, which may cause confusing behavior unless made explicit." ,
132
+ @Deprecated(
133
+ " This property delegates to the test scheduler, which may cause confusing behavior unless made explicit." ,
131
134
ReplaceWith (" this.scheduler.currentTime" ),
132
- level = DeprecationLevel .WARNING )
133
- override val currentTime: Long get() = scheduler.currentTime
135
+ level = DeprecationLevel .WARNING
136
+ )
137
+ override val currentTime: Long
138
+ get() = scheduler.currentTime
134
139
135
140
136
141
/* * @suppress */
137
- @Deprecated(" This function delegates to the test scheduler, which may cause confusing behavior unless made explicit." ,
142
+ @Deprecated(
143
+ " This function delegates to the test scheduler, which may cause confusing behavior unless made explicit." ,
138
144
ReplaceWith (" this.scheduler.apply { advanceTimeBy(delayTimeMillis); runCurrent() }" ),
139
- level = DeprecationLevel .WARNING )
145
+ level = DeprecationLevel .WARNING
146
+ )
140
147
override fun advanceTimeBy (delayTimeMillis : Long ): Long {
141
148
val oldTime = scheduler.currentTime
142
149
scheduler.advanceTimeBy(delayTimeMillis)
@@ -145,19 +152,23 @@ internal interface SchedulerAsDelayController: DelayController {
145
152
}
146
153
147
154
/* * @suppress */
148
- @Deprecated(" This function delegates to the test scheduler, which may cause confusing behavior unless made explicit." ,
155
+ @Deprecated(
156
+ " This function delegates to the test scheduler, which may cause confusing behavior unless made explicit." ,
149
157
ReplaceWith (" this.scheduler.advanceUntilIdle()" ),
150
- level = DeprecationLevel .WARNING )
158
+ level = DeprecationLevel .WARNING
159
+ )
151
160
override fun advanceUntilIdle (): Long {
152
161
val oldTime = scheduler.currentTime
153
162
scheduler.advanceUntilIdle()
154
163
return scheduler.currentTime - oldTime
155
164
}
156
165
157
166
/* * @suppress */
158
- @Deprecated(" This function delegates to the test scheduler, which may cause confusing behavior unless made explicit." ,
167
+ @Deprecated(
168
+ " This function delegates to the test scheduler, which may cause confusing behavior unless made explicit." ,
159
169
ReplaceWith (" this.scheduler.runCurrent()" ),
160
- level = DeprecationLevel .WARNING )
170
+ level = DeprecationLevel .WARNING
171
+ )
161
172
override fun runCurrent (): Unit = scheduler.runCurrent()
162
173
163
174
/* * @suppress */
0 commit comments