-
Notifications
You must be signed in to change notification settings - Fork 6k
Conversation
7ab298b
to
eb352c0
Compare
1. Bump sdk to 32. 2. Remove icu4j from testImplementation because Robolectric has a higher icu4j dependency. Signed-off-by: utzcoz <[email protected]>
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]>
Before Robolectric 4.8, From Robolectric 4.8, it supports to shadow |
Hi @blasten , @jason-simmons , could you help to review this PR? Thanks. |
This reverts commit 2857531.
Hi @jason-simmons , I saw you added a new commit to revert it, does it cause new problem? I can try to fix it. |
The Robolectric tests were failing in the CI environment Example: https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20Android%20Debug%20Engine/16477/overview |
Thanks. I will test it locally, and try to re-land it again. |
@jason-simmons The failed tests are added at e986f43 after my PR. I will try to resolve it compatibility on Robolectric 4.8.1. |
PlatformViewsControllerTest#disposeNullAndroidView
with Robolectric 4.8.x.Pre-launch Checklist
writing and running engine tests.
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.