[ai-glasses] add in projected unit tests#856
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces testing infrastructure for XR projected features, including new dependencies in the version catalog and a dedicated test class. The reviewer suggested upgrading the Mockito Kotlin version for better compatibility, renaming the test core-ktx dependency to avoid confusion with the standard core-ktx library, and ensuring the test file name matches the class name.
gradle/libs.versions.toml
Outdated
| material3-adaptive-navigation-suite = "1.4.0" | ||
| media3 = "1.9.2" | ||
| media3Ui = "1.9.2" | ||
| mockitoKotlin = "4.1.0" |
There was a problem hiding this comment.
The version of mockito-kotlin being added (4.1.0) is quite outdated, released in November 2021. The latest version is 5.3.1. It's highly recommended to use a more recent version to benefit from bug fixes, new features, and improved compatibility with newer Kotlin versions.
| mockitoKotlin = "4.1.0" | |
| mockitoKotlin = "5.3.1" |
There was a problem hiding this comment.
@trambui09 The version 6.3 is already out, can we switch it here? https://github.com/mockito/mockito-kotlin/releases/tag/v6.3.0
There was a problem hiding this comment.
resolving from conversation. will keep it to "5.3.1"
gradle/libs.versions.toml
Outdated
| coil-kt-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" } | ||
| compose-foundation = { module = "androidx.wear.compose:compose-foundation", version.ref = "wearComposeFoundation" } | ||
| compose-ui-tooling = { module = "androidx.wear.compose:compose-ui-tooling", version.ref = "composeUiTooling" } | ||
| core-ktx = { module = "androidx.test:core-ktx", version.ref = "coreKtx" } |
There was a problem hiding this comment.
The alias core-ktx for androidx.test:core-ktx can be easily confused with the existing androidx-core-ktx alias for androidx.core:core-ktx. To improve clarity and prevent potential mix-ups, consider a more descriptive name for the test dependency, such as androidx-test-core-ktx.
This would involve:
- Renaming the version alias on line 48 from
coreKtxto something likeandroidxTestCoreKtx. - Renaming this library alias to
androidx-test-core-ktxand updating itsversion.ref. - Updating
xr/build.gradle.ktsto uselibs.androidx.test.core.ktx.
There was a problem hiding this comment.
This has been addressed.
| @RunWith(AndroidJUnit4::class) | ||
| @Config(sdk = [Build.VERSION_CODES.UPSIDE_DOWN_CAKE]) | ||
| @OptIn(ExperimentalProjectedApi::class) | ||
| class ProjectedFeatureTest { |
There was a problem hiding this comment.
8a0f973 to
9743407
Compare
|
Here is the summary of changes. You are about to add 3 region tags.
This comment is generated by snippet-bot.
|
9a61daf to
e857d2e
Compare
kkuan2011
left a comment
There was a problem hiding this comment.
LGTM from snippets repo perspective
vad710
left a comment
There was a problem hiding this comment.
Left a few comments in the internal doc. Mostly around null and connection state checks.
|
Hello everyone, First of all, I'd like to express my appreciation for the outstanding work you have done — it is much valued. I would like to kindly ask whether it would be possible to provide some basic documentation on the simulator configuration. I have been able to compile the code without issues, however I am unable to obtain any results within the simulator and I believe some configuration steps may be missing on my end. Thank you in advance for any support you can offer. |
Add in ProjectedTestRules coverage, testing: