Home
last modified time | relevance | path

Searched refs:coroutineContext (Results 1 – 25 of 121) sorted by relevance

12345

/external/kotlinx.coroutines/kotlinx-coroutines-core/common/test/
DWithContextTest.kt18 withContext<Unit>(coroutineContext) { in <lambda>()
34 withContext<Unit>(wrapperDispatcher(coroutineContext)) { in <lambda>()
49 launch(coroutineContext) { // make sure there is not early dispatch here in <lambda>()
53 val result = withContext(coroutineContext) { // same context! in <lambda>()
65 launch(coroutineContext) { // make sure there is not early dispatch here in <lambda>()
69 val result = withContext(coroutineContext) { // same context! in <lambda>()
82 launch(coroutineContext) { // make sure there is not early dispatch to here in <lambda>()
88 withContext(coroutineContext + job) { in <lambda>()
113 launch(coroutineContext) { // make sure there is not early dispatch to here in <lambda>()
118 withContext(coroutineContext + job) { // same context + new job in <lambda>()
[all …]
DJobExtensionsTest.kt20 coroutineContext.ensureActive() in <lambda>()
21 coroutineContext[Job]!!.ensureActive() in <lambda>()
29 scope.coroutineContext.ensureActive() in <lambda>()
39 coroutineContext.ensureActive() in <lambda>()
40 coroutineContext[Job]!!.ensureActive() in <lambda>()
49 assertFailsWith<JobCancellationException> { scope.coroutineContext.ensureActive() } in <lambda>()
59 coroutineContext.ensureActive() in <lambda>()
60 coroutineContext[Job]!!.ensureActive() in <lambda>()
68 checkException { scope.coroutineContext.ensureActive() } in <lambda>()
88 assertSame(coroutineContext[Job]!!, coroutineContext.job) in <lambda>()
DAbstractCoroutineTest.kt15 val coroutineContext = coroutineContext // workaround for KT-22984 in <lambda>() constant
16 val coroutine = object : AbstractCoroutine<String>(coroutineContext, false) { in <lambda>()
55 val coroutineContext = coroutineContext // workaround for KT-22984 in <lambda>() constant
56 … val coroutine = object : AbstractCoroutine<String>(coroutineContext + NonCancellable, false) { in <lambda>()
DParentCancellationTest.kt20 val child = Job(coroutineContext[Job]) in <lambda>()
21 CoroutineScope(coroutineContext + child).fail() in <lambda>()
28 val child = SupervisorJob(coroutineContext[Job]) in <lambda>()
29 CoroutineScope(coroutineContext + child).fail() in <lambda>()
36 val child = CompletableDeferred<Unit>(coroutineContext[Job]) in <lambda>()
37 CoroutineScope(coroutineContext + child).fail() in <lambda>()
133 val scope = CoroutineScope(coroutineContext + parent) in <lambda>()
/external/kotlinx.coroutines/kotlinx-coroutines-core/jvm/test/
DRunBlockingTest.kt29 assertTrue(coroutineContext[ContinuationInterceptor] is EventLoop) in testPrivateEventLoop()
41 val outerEventLoop = coroutineContext[ContinuationInterceptor] as EventLoop in testOuterEventLoop()
42 runBlocking(coroutineContext) { in testOuterEventLoop()
45 assertSame(coroutineContext[ContinuationInterceptor], outerEventLoop) in testOuterEventLoop()
61 assertSame(coroutineContext[ContinuationInterceptor], thread) in testOtherDispatcher()
74 runBlocking(coroutineContext) { in testCancellation()
92 coroutineContext.cancel() in testCancelWithDelay()
121 coroutineContext.cancel() in <lambda>()
127 coroutineContext.cancel() in <lambda>()
160 coroutineContext[Job]!!.invokeOnCompletion { } in testIncompleteState()
DReusableCancellableContinuationTest.kt30 val job = coroutineContext[Job]!! in testContinuationsCount()
78 FieldWalker.assertReachableCount(1, coroutineContext[Job]) { it === continuation } in <lambda>()
82 coroutineContext[Job]!!.cancel() in <lambda>()
102 assertTrue { FieldWalker.walk(coroutineContext[Job]).contains(cont!!) } in <lambda>()
117 FieldWalker.assertReachableCount(0, coroutineContext[Job]) { it === cont } in <lambda>()
132 FieldWalker.assertReachableCount(0, coroutineContext[Job]) { it === cont } in testDetachedOnCancel()
139 val currentJob = coroutineContext[Job]!!
195 val job = coroutineContext[Job]!! in <lambda>()
216 FieldWalker.assertReachableCount(1, coroutineContext[Job]) { it is ChildContinuation } in <lambda>()
DThreadContextElementTest.kt15 val exceptionHandler = coroutineContext[CoroutineExceptionHandler]!! in <lambda>()
16 val mainDispatcher = coroutineContext[ContinuationInterceptor]!! in <lambda>()
23 assertSame(element, coroutineContext[MyElement]) in <lambda>()
27 assertSame(element, coroutineContext[MyElement]) in <lambda>()
31 assertSame(element, coroutineContext[MyElement]) in <lambda>()
41 val exceptionHandler = coroutineContext[CoroutineExceptionHandler]!! in testUndispatched()
/external/kotlinx.coroutines/kotlinx-coroutines-core/common/test/flow/operators/
DCatchTest.kt100 val d0 = coroutineContext[ContinuationInterceptor] as CoroutineContext in <lambda>()
101 val d1 = wrapperDispatcher(coroutineContext) in <lambda>()
102 val d2 = wrapperDispatcher(coroutineContext) in <lambda>()
107 assertEquals("A", kotlin.coroutines.coroutineContext[CoroutineName]?.name) in <lambda>()
108 … assertSame(d1, kotlin.coroutines.coroutineContext[ContinuationInterceptor] as CoroutineContext) in <lambda>()
115 assertEquals("B", kotlin.coroutines.coroutineContext[CoroutineName]?.name) in <lambda>()
116 … assertSame(d1, kotlin.coroutines.coroutineContext[ContinuationInterceptor] as CoroutineContext) in <lambda>()
123 … assertSame(d1, kotlin.coroutines.coroutineContext[ContinuationInterceptor] as CoroutineContext) in <lambda>()
130 … assertSame(d2, kotlin.coroutines.coroutineContext[ContinuationInterceptor] as CoroutineContext) in <lambda>()
142 … assertSame(d0, kotlin.coroutines.coroutineContext[ContinuationInterceptor] as CoroutineContext) in <lambda>()
/external/kotlinx.coroutines/kotlinx-coroutines-core/common/src/
DCoroutineScope.kt72 public val coroutineContext: CoroutineContext in <lambda>() constant
82 ContextScope(coroutineContext + context) in plus()
123 get() = coroutineContext[Job]?.isActive ?: true in plus()
150 override val coroutineContext: CoroutineContext in plus() constant
216 …val job = coroutineContext[Job] ?: error("Scope cannot be cancelled because it does not have a job… in CoroutineScope()
243 public fun CoroutineScope.ensureActive(): Unit = coroutineContext.ensureActive()
259 public suspend inline fun currentCoroutineContext(): CoroutineContext = coroutineContext
/external/kotlinx.coroutines/kotlinx-coroutines-test/src/
DTestCoroutineScope.kt27 override val coroutineContext: CoroutineContext in cleanupTestCoroutines() constant in kotlinx.coroutines.test.TestCoroutineScopeImpl
30 UncaughtExceptionCaptor by coroutineContext.uncaughtExceptionCaptor, in cleanupTestCoroutines()
31 DelayController by coroutineContext.delayController in cleanupTestCoroutines()
34 coroutineContext.uncaughtExceptionCaptor.cleanupTestCoroutines() in cleanupTestCoroutines()
35 coroutineContext.delayController.cleanupTestCoroutines() in cleanupTestCoroutines()
/external/kotlinx.coroutines/reactive/kotlinx-coroutines-reactive/src/
DReactiveFlow.kt74 val collectContext = coroutineContext in <lambda>()
98 coroutineContext.ensureActive() in <lambda>()
112 collectImpl(scope.coroutineContext, SendingCollector(scope.channel)) in <lambda>()
163 internal fun <T> Publisher<T>.injectCoroutineContext(coroutineContext: CoroutineContext) = in injectCoroutineContext()
164 …old(this) { pub, contextInjector -> contextInjector.injectCoroutineContext(pub, coroutineContext) } in injectCoroutineContext()
192 private fun createInitialContinuation(): Continuation<Unit> = Continuation(coroutineContext) { in <lambda>()
209 handleCoroutineException(coroutineContext, e) in flowProcessing()
228 coroutineContext.ensureActive() in consumeFlow()
/external/kotlinx.coroutines/ui/kotlinx-coroutines-android/android-unit-tests/src/
DEmptyCoroutineScopeImpl.kt12 override val coroutineContext: CoroutineContext constant in kotlinx.coroutines.android.EmptyCoroutineScopeImpl1
17 override val coroutineContext: CoroutineContext constant in kotlinx.coroutines.android.EmptyCoroutineScopeImpl2
22 override val coroutineContext: CoroutineContext constant in kotlinx.coroutines.android.EmptyCoroutineScopeImpl3
/external/kotlinx.coroutines/ui/kotlinx-coroutines-swing/test/
DSwingTest.kt36 private class SwingComponent(coroutineContext: CoroutineContext = EmptyCoroutineContext) : in <lambda>()
37 CoroutineScope by MainScope() + coroutineContext in <lambda>()
61 component.coroutineContext[Job]!!.join() in <lambda>()
84 component.coroutineContext[Job]!!.join() in <lambda>()
/external/kotlinx.coroutines/kotlinx-coroutines-test/test/
DTestRunBlockingTest.kt60 val outerInterceptor = coroutineContext[ContinuationInterceptor] in <lambda>()
63 assertNotSame(coroutineContext[ContinuationInterceptor], outerInterceptor) in <lambda>()
378 assertEquals(CoroutineName("named"), coroutineContext[CoroutineName]) in <lambda>()
379 assertNotNull(coroutineContext[CoroutineExceptionHandler]) in <lambda>()
380 assertNotSame(coroutineContext[CoroutineExceptionHandler], exceptionHandler) in <lambda>()
390 assertSame(coroutineContext[CoroutineExceptionHandler], exceptionHandler) in <lambda>()
DTestBuildersTest.kt18 …assertSame(scope.coroutineContext[ContinuationInterceptor], coroutineContext[ContinuationIntercept… in scopeRunBlocking_passesDispatcher()
26 assertSame(dispatcher, coroutineContext[ContinuationInterceptor]) in dispatcherRunBlocking_passesDispatcher()
/external/kotlinx.coroutines/kotlinx-coroutines-core/jvm/test/exceptions/
DStackTraceRecoveryCustomExceptionsTest.kt33 withContext(wrapperDispatcher(coroutineContext)) { in testStackTraceNotRecovered()
46 withContext(wrapperDispatcher(coroutineContext)) { in <lambda>()
63 withContext(wrapperDispatcher(coroutineContext)) { in <lambda>()
DSuppressionTests.kt18 val coroutineContext = kotlin.coroutines.coroutineContext // workaround for KT-22984 in <lambda>() constant
19 val coroutine = object : AbstractCoroutine<String>(coroutineContext, false) { in <lambda>()
/external/kotlinx.coroutines/kotlinx-coroutines-core/common/test/channels/
DProduceTest.kt95 cancelOnCompletion(coroutineContext) in <lambda>()
163 …private suspend fun cancelOnCompletion(coroutineContext: CoroutineContext) = CoroutineScope(corout… in <lambda>()
166 … val produced = produce<Int>(coroutineContext, onCompletion = { source.cancelConsumed(it) }) { in <lambda>()
/external/kotlinx.coroutines/kotlinx-coroutines-core/jvm/src/
DInterruptible.kt38 runInterruptibleInExpectedContext(coroutineContext, block) in <lambda>()
41 private fun <T> runInterruptibleInExpectedContext(coroutineContext: CoroutineContext, block: () -> … in runInterruptibleInExpectedContext()
43 val threadState = ThreadState(coroutineContext.job) in runInterruptibleInExpectedContext()
DThreadContextElement.kt153 public suspend inline fun ThreadLocal<*>.isPresent(): Boolean = coroutineContext[ThreadLocalKey(thi… in updateThreadContext()
174 check(isPresent()) { "ThreadLocal $this is missing from context $coroutineContext" } in updateThreadContext()
/external/kotlinx.coroutines/reactive/kotlinx-coroutines-jdk9/test/
DIntegrationTest.kt42 val pub = flowPublish<String>(ctx(coroutineContext)) { in <lambda>()
59 val pub = flowPublish(ctx(coroutineContext)) { in <lambda>()
80 val pub = flowPublish(ctx(coroutineContext)) { in <lambda>()
94 checkNumbers(n, flow.flowOn(ctx(coroutineContext)).asPublisher()) in <lambda>()
/external/kotlinx.coroutines/reactive/kotlinx-coroutines-rx3/test/
DIntegrationTest.kt42 val observable = rxObservable<String>(ctx(coroutineContext)) { in <lambda>()
61 val observable = rxObservable(ctx(coroutineContext)) { in <lambda>()
82 val observable = rxObservable(ctx(coroutineContext)) { in <lambda>()
96 ctx(coroutineContext) in <lambda>()
/external/kotlinx.coroutines/reactive/kotlinx-coroutines-rx2/test/
DIntegrationTest.kt42 val observable = rxObservable<String>(ctx(coroutineContext)) { in <lambda>()
61 val observable = rxObservable(ctx(coroutineContext)) { in <lambda>()
82 val observable = rxObservable(ctx(coroutineContext)) { in <lambda>()
96 checkNumbers(n, channel.consumeAsFlow().asObservable(ctx(coroutineContext))) in <lambda>()
/external/kotlinx.coroutines/kotlinx-coroutines-core/common/test/flow/sharing/
DSharingStartedTest.kt116 val dsl = SharingStartedDsl(started, initialCommand, coroutineContext) in testSharingStarted()
130 coroutineContext: CoroutineContext
137 val dispatcher = coroutineContext[ContinuationInterceptor] as VirtualTimeDispatcher
138 val scope = CoroutineScope(coroutineContext + Job())
/external/kotlinx.coroutines/reactive/kotlinx-coroutines-reactive/test/
DIntegrationTest.kt41 val pub = publish<String>(ctx(coroutineContext)) { in <lambda>()
61 val pub = publish(ctx(coroutineContext)) { in <lambda>()
85 val pub = publish(ctx(coroutineContext)) { in <lambda>()
102 checkNumbers(n, channel.asPublisher(ctx(coroutineContext))) in <lambda>()

12345