bump robolectric and java to 21 (#175550)

Bumps robolectric to support Android API 36 and JDK to 21
One of the tests is failing due to a change in how JDK 19 handles
unicode characters in word breaks. The test was skipped and a new issue
was created below.
https://github.com/flutter/flutter/issues/175623

Resolves https://github.com/flutter/flutter/issues/175454
Unblocks https://github.com/flutter/flutter/pull/174981

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
This commit is contained in:
ash2moon 2025-09-22 13:10:47 -07:00 committed by GitHub
parent 6efb99982d
commit d5592e4e8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 7 additions and 4 deletions

2
DEPS
View File

@ -634,7 +634,7 @@ deps = {
'packages': [
{
'package': 'flutter/java/openjdk/${{platform}}',
'version': 'version:17'
'version': 'version:21'
}
],
# Always download the JDK since java is required for running the formatter.

View File

@ -49,7 +49,7 @@ public class DartExecutorTest {
assertNotNull(dartExecutor.getBinaryMessenger());
// Execute the behavior under test.
ByteBuffer fakeMessage = mock(ByteBuffer.class);
ByteBuffer fakeMessage = ByteBuffer.allocate(0);
dartExecutor.getBinaryMessenger().send("fake_channel", fakeMessage);
// Verify that DartExecutor sent our message to FlutterJNI.

View File

@ -58,6 +58,7 @@ import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
@ -1597,6 +1598,8 @@ public class AccessibilityBridgeTest {
assertNotEquals(event.getEventType(), AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED);
}
@Ignore(
"Fails on JDK 19+ due to https://github.com/flutter/flutter/issues/175623. Not an actual bug on device; test-specific only.")
@Test
public void itCanPredictCursorMovementsWithGranularityWordUnicode() {
AccessibilityChannel mockChannel = mock(AccessibilityChannel.class);

View File

@ -72,7 +72,7 @@ android {
//noinspection RiskyLibrary,PlaySdkIndexDeprecated
testImplementation "com.google.android.play:core:1.8.0"
testImplementation "com.ibm.icu:icu4j:75.1"
testImplementation "org.robolectric:robolectric:4.14.1"
testImplementation "org.robolectric:robolectric:4.16"
testImplementation "junit:junit:4.13.2"
testImplementation "androidx.test.ext:junit:1.2.1"

View File

@ -1,2 +1,2 @@
sdk=35
sdk=36
shadows=io.flutter.CustomShadowContextImpl