Skip to content

Commit efa109d

Browse files
authored
Add entry-point annotations for test-only code. (flutter#160158)
This change adds entry-point annotations to methods and classes accessed by native code during Flutter tests. Currently, entry point annotations are not checked by the Dart VM when running in JIT mode, only in AOT mode. In order to also enforce entry point annotations in JIT mode, first tests in Flutter must be appropriately annotated to avoid roll failures. Related issues: * flutter#118608 * dart-lang/sdk#50649 ## Pre-launch Checklist - [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]. <!-- 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
1 parent 2d3ff85 commit efa109d

File tree

7 files changed

+7
-0
lines changed

7 files changed

+7
-0
lines changed

packages/flutter/test/cupertino/dialog_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2063,6 +2063,7 @@ Widget createAppWithCenteredButton(Widget child) {
20632063
}
20642064

20652065

2066+
@pragma('vm:entry-point')
20662067
class _RestorableDialogTestWidget extends StatelessWidget {
20672068
const _RestorableDialogTestWidget();
20682069

packages/flutter/test/cupertino/route_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3177,6 +3177,7 @@ class _TestPostRouteCancelState extends State<_TestPostRouteCancel> {
31773177
}
31783178
}
31793179

3180+
@pragma('vm:entry-point')
31803181
class _RestorableModalTestWidget extends StatelessWidget {
31813182
const _RestorableModalTestWidget();
31823183

packages/flutter/test/material/date_picker_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2620,6 +2620,7 @@ class _RestorableDatePickerDialogTestWidget extends StatefulWidget {
26202620
_RestorableDatePickerDialogTestWidgetState createState() => _RestorableDatePickerDialogTestWidgetState();
26212621
}
26222622

2623+
@pragma('vm:entry-point')
26232624
class _RestorableDatePickerDialogTestWidgetState extends State<_RestorableDatePickerDialogTestWidget> with RestorationMixin {
26242625
@override
26252626
String? get restorationId => 'scaffold_state';

packages/flutter/test/material/date_range_picker_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,6 +1785,7 @@ class _RestorableDateRangePickerDialogTestWidget extends StatefulWidget {
17851785
_RestorableDateRangePickerDialogTestWidgetState createState() => _RestorableDateRangePickerDialogTestWidgetState();
17861786
}
17871787

1788+
@pragma('vm:entry-point')
17881789
class _RestorableDateRangePickerDialogTestWidgetState extends State<_RestorableDateRangePickerDialogTestWidget> with RestorationMixin {
17891790
@override
17901791
String? get restorationId => 'scaffold_state';

packages/flutter/test/material/dialog_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2975,6 +2975,7 @@ void main() {
29752975
});
29762976
}
29772977

2978+
@pragma('vm:entry-point')
29782979
class _RestorableDialogTestWidget extends StatelessWidget {
29792980
const _RestorableDialogTestWidget();
29802981

packages/flutter/test/material/time_picker_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2212,6 +2212,7 @@ class _TimePickerLauncher extends StatefulWidget {
22122212
_TimePickerLauncherState createState() => _TimePickerLauncherState();
22132213
}
22142214

2215+
@pragma('vm:entry-point')
22152216
class _TimePickerLauncherState extends State<_TimePickerLauncher> with RestorationMixin {
22162217
@override
22172218
String? get restorationId => widget.restorationId;

packages/flutter/test/widgets/routes_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2600,6 +2600,7 @@ class WidgetWithNoLocalHistoryState extends State<WidgetWithNoLocalHistory> {
26002600
}
26012601
}
26022602

2603+
@pragma('vm:entry-point')
26032604
class _RestorableDialogTestWidget extends StatelessWidget {
26042605
const _RestorableDialogTestWidget();
26052606

0 commit comments

Comments
 (0)