test: screenshot plain Android view in IsolatedTest#100
Open
EmilioBejasa wants to merge 4 commits intomainfrom
Open
test: screenshot plain Android view in IsolatedTest#100EmilioBejasa wants to merge 4 commits intomainfrom
EmilioBejasa wants to merge 4 commits intomainfrom
Conversation
Verifies the screenshot infrastructure works without React Native. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Test Replaces the plain Android view screenshot with an actual React Native surface screenshot, which is the real goal of this isolated test. Uses the same WindowManager + software layer approach as BaseStoryScreenshotTest so Fabric can commit its render tree in a test process. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tSimpleTestComponent - Use ContextThemeWrapper (matches BaseStoryScreenshotTest pattern) - Poll childCount on main thread with 30s timeout to handle cold JS bundle load - Set software layer recursively after Fabric mounts children (child views default to hardware acceleration which Screenshot.snap() can't capture) - Call Screenshot.snap() on the main thread Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tdrhq
reviewed
Apr 2, 2026
| val view = surface.view | ||
| ?: throw IllegalStateException("ReactSurface returned a null view") | ||
|
|
||
| val wm = context.getSystemService(android.content.Context.WINDOW_SERVICE) as WindowManager |
Contributor
There was a problem hiding this comment.
you're going in circles, I think we specifically said we didn't want to do it using WindowManager.
tdrhq
reviewed
Apr 2, 2026
| PixelFormat.TRANSLUCENT | ||
| ).apply { alpha = 0f } | ||
|
|
||
| instrumentation.runOnMainSync { |
Contributor
There was a problem hiding this comment.
we also specifically said we wanted to do everything without inter-thread synchronization. There can be one runOnMainSync, but all the code needs to be in it.
tdrhq
requested changes
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
screenshotPlainViewtest toIsolatedTestthat snapshots a plain AndroidViewmeasure()+layout()manually before snappingTest plan
screenshotPlainViewtest greenplain_view🤖 Generated with Claude Code