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

Update VideoAudioTest to auto-delete saved videos #267

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

temcguir
Copy link
Collaborator

This will run VideoAudioTest with
runMediaStoreAutoDeleteScenarioTest to ensure that
any recorded videos are deleted when the test finishes.

It also changes the way we detect the hot mic. Instead of
changing the test tag, we change the semantic state
description when the mic indicates we're recording audio.
This allows ComposeTest to wait for this state where
before it was unable to detect test tag changes.

We also will no longer use longClick since it does not
seem to work well on emulators. We implicitly send the
down and up events instead. This seems to allow us to
run this test on emulators.

 When running JCA without an explicit intent mode, the files are
 saved to MediaStore. This installs a watch on the MediaStore to
 delete any files that are created during tests.
 Video capture seems to be saving a 3gp file without the filename
 specified. Remove the "JCA" prefix check for now in order to
 ensure this file gets deleted in tests.
 Adds test tag to CaptureModeToggleButton

 Adds state descriptions to ToggleButton

 Removes unnecessary coroutine scope from ToggleButton
 Adds tests to ensure Concurrent Camera can be enabled without
 crashing the app, and appropriate features are disabled when
 concurrent camera mode is enabled.

 Also ensures that recordings can be made in concurrent camera
 mode.
 This will run VideoAudioTest with
 `runMediaStoreAutoDeleteScenarioTest` to ensure that
 any recorded videos are deleted when the test finishes.

 It also changes the way we detect the hot mic. Instead of
 changing the test tag, we change the semantic state
 description when the mic indicates we're recording audio.
 This allows ComposeTest to wait for this state where
 before it was unable to detect test tag changes.

 We also will no longer use longClick since it does not
 seem to work well on emulators. We implicitly send the
 down and up events instead. This seems to allow us to
 run this test on emulators.
@temcguir temcguir requested a review from Kimblebee September 18, 2024 18:19
Base automatically changed from temcguir/concurrent_camera_tests to main September 18, 2024 19:42
Copy link
Collaborator

@Kimblebee Kimblebee left a comment

Choose a reason for hiding this comment

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

looks good to me!

I think when I first read about adjusting semantics properties, I had confused contentDescription with stateDescription. So I opted to change testTags instead because I did not want to change the accessibility descriptions.

I wonder what other tests may be better off using stateDescription instead of changing testTags instead.

) {
// check audio visualizer composable for muted/unmuted icon.
// icon will only be unmuted if audio is nonzero
with(composeTestRule) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is with(...) doing differently?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

with(...) turns the argument into a receiver. That is, it makes "composeTestRule" part of the context of the lambda that runs. It means we don't need to write composeTestRule before each of the commands.

In this case it's making the code less verbose (at the expense of an increase in indentation).

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.

2 participants