Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commonize lifecycle tests #1330

Open
wants to merge 3 commits into
base: jb-main
Choose a base branch
from

Conversation

kropp
Copy link
Member

@kropp kropp commented Apr 29, 2024

Commonize Lifecycle tests.
These tests are heavily relied on Dispatchers.Main, which involves intricate test environment setup.

After PR is ready, I'm not going to merge it, instead I'll upstream it to androidx repository directly.

Testing

Run ./gradlew :lifecycle:lifecycle-runtime:allTests

… any supported platform

For some platforms, surrogate Main threads are provided
some tests were minimally adjusted due to missing multi-platform APIs
@@ -1,5 +1,5 @@
/*
* Copyright 2019 The Android Open Source Project
* Copyright 2024 The Android Open Source Project
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert updating years in header comments

import java.util.concurrent.atomic.AtomicInteger
import androidx.kruth.assertThat
import kotlinx.atomicfu.atomic

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants