-
Notifications
You must be signed in to change notification settings - Fork 6k
Add API consistency test #32408
Add API consistency test #32408
Conversation
This is expected to fail until the following patches are landed:
|
Looks like I missed a couple. I'll add the check for the internal SemanticsFlags etc. enums from semantics_node.h and see if I can get the Java one added for Android. |
Adding @chinmaygarde since as written, this test will require the embedder API to be updated whenever public dart:ui enums are updated. That increases the odds that if we deprecate and remove one of these values from dart:ui, that someone might be tempted to remove it from the embedder API rather than update the test to support deprecated values remaining in the embedder API to keep our compatibility guarantees. |
Classes that model enums in dart:ui typically name fields modelling the enum values as `_kFooIndex`. This associated value matches the enum value from embedder.h. In #32408 we add a test that verifies that dart:ui classes model the same set of values in the native implementation, the web_ui implementation, and the embedder API. Testing this is much simpler if we use consistent naming for all enum values. Issue: #32408
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an entry to https://github.com/flutter/engine/blob/main/tools/pub_get_offline.py#L17
This brings the Android accessibility bridge AccessibilityFeature enum back in sync with the `AccessibilityFeatures` class in dart:ui, defined in lib/ui/window.dart Keeping these enums in sync aids in automated API consistency checking. Issue: flutter/flutter#101217
This pull request is not suitable for automatic merging in its current state.
|
Several enumerations need to be kept consistent between our native and
web dart:ui implementations and the embedder API implementation. There
are comments above each enum/class reminding SDK developers to keep
these in sync, but these frequently get out of sync.
This adds a test that verifies consistency between the identifiers in
these classes/enums to prevent them getting out of sync.
Issue: flutter/flutter#101217
Pre-launch Checklist
writing and running engine tests.
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.