Skip to content

Fix CaptureModeSettingsTest.hdr_supports_image_only assertions - #543

Merged
temcguir merged 4 commits into
mainfrom
david/hdrTestFix
Jul 31, 2026
Merged

Fix CaptureModeSettingsTest.hdr_supports_image_only assertions#543
temcguir merged 4 commits into
mainfrom
david/hdrTestFix

Conversation

@davidjiagoogle

@davidjiagoogle davidjiagoogle commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Description

Fixes assertion logic in CaptureModeSettingsTest.hdr_supports_image_only and adds hdr_toggle_maintains_video_capture_mode().

Key Nuances & Updates:

  • Device Hardware Nuance: On devices supporting both HLG10 Video and Ultra HDR (such as Pixel 10 Pro), enabling HDR does not disable the capture mode toggle button because both image and video modes remain supported under HDR. The test uses assume().that(isCaptureModeToggleEnabled()).isTrue() / isFalse() to safely handle device capability variations.
  • Assertion Fixes in hdr_supports_image_only:
    • Corrects the post-HDR assertion to verify that captureMode remains CaptureMode.IMAGE_ONLY when HDR is turned off, as disabling HDR restores format selection but does not alter explicit capture mode selection.
    • Verifies that the capture mode toggle UI is enabled once HDR is turned off.
  • Added hdr_toggle_maintains_video_capture_mode(): Adds a test verifying that when HDR is enabled on devices supporting multi-stream HDR, toggling capture mode successfully switches to CaptureMode.VIDEO_ONLY.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates CaptureModeSettingsTest.kt by replacing assume() calls with assertThat() assertions. It also updates the test assertions after disabling HDR to verify that the capture mode toggle becomes enabled and the capture mode setting state is CaptureMode.IMAGE_ONLY. I have no feedback to provide as there are no review comments.

@temcguir
temcguir merged commit a520145 into main Jul 31, 2026
12 checks passed
@temcguir
temcguir deleted the david/hdrTestFix branch July 31, 2026 20:49
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