You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Before Robolectric 4.8, Surface#lockHardwareCanvas will throw
exception at PlatformViewWrapper#setTexture, because Robolectric
doesn't support to shadow Surface#lockHardwareCanvas, and it
uses real Android logic with native pointer address is 0.
This failure will ensure embeddedView's parent is null, because
PlatformViewsController#createForTextureLayer will fail because
of previous mentioned error, and PlatformViewsController#createForTextureLayer
will not add embeddedView to wrapperView. So this test can pass.
From Robolectric 4.8, it supports to shadow Surface#lockHardwareCanvas
and it can pass with default true valid value, and
PlatformViewsController#createForTextureLayer will run correctly
and add embeddedView to wrapperView, and initializePlatformViewIfNeeded
will fail because embeddedView's parent is not null. So adding a new shadow
class called ShadowReleasedSurface to simulate previous
Surface#lockHardwareCanvas failure to ensure this test can work with
Robolectric 4.8 and later versions. But it is just a workaround,
the root cause is this test case depends on just-failure behavior of
Surface#lockHardwareCanvas in old Robolectric.
Signed-off-by: utzcoz <[email protected]>
0 commit comments