flutter/packages/flutter_test/test
Michael Goderbauer 4534a24c09
Reapply "Dynamic view sizing" (#140165) (#140918)
This reverts commit
d24c01bd0c.

The original change was reverted because it caused some apps to get
stuck on the splash screen on some phones.

An investigation determined that this was due to a rounding error.
Example: The device reports a physical size of 1008.0 x 2198.0 with a
dpr of 1.912500023841858. Flutter would translate that to a logical size
of 527.0588169589221 x 1149.2810314243163 and use that as the input for
its layout algorithm. Since the constraints here are tight, the layout
algorithm would determine that the resulting logical size of the root
render object must be 527.0588169589221 x 1149.2810314243163.
Translating this back to physical pixels by applying the dpr resulted in
a physical size of 1007.9999999999999 x 2198.0 for the frame. Android
now rejected that frame because it didn't match the expected size of
1008.0 x 2198.0 and since no frame had been rendered would never take
down the splash screen.

Prior to dynamically sized views, this wasn't an issue because we would
hard-code the frame size to whatever the requested size was.

Changes in this PR over the original PR:

* The issue has been fixed now by constraining the calculated physical
size to the input physical constraints which makes sure that we always
end up with a size that is acceptable to the operating system.
* The `ViewConfiguration` was refactored to use the slightly more
convenient `BoxConstraints` over the `ViewConstraints` to represent
constraints. Both essentially represent the same thing, but
`BoxConstraints` are more powerful and we avoid a couple of translations
between the two by translating the` ViewConstraints` from the
`FlutterView` to `BoxConstraints` directly when the `ViewConfiguration`
is created.

All changes over the original PR are contained in the second commit of
this PR.

Fixes b/316813075
Part of https://github.com/flutter/flutter/issues/134501.
2024-01-09 14:10:43 -08:00
..
bindings_environment
custom_exception_reporter
semantics_checker Stand-alone widget tree with multiple render trees to enable multi-view rendering (#125003) 2023-07-17 16:14:08 +00:00
test_config Enable private field promotion for other packages (#134475) 2023-09-12 21:08:19 +00:00
utils Upgrade leak_tracker. (#141153) 2024-01-09 12:02:35 -08:00
accessibility_test.dart Update misc tests for Material3 (#128712) 2023-06-13 08:57:27 -07:00
accessibility_window_test.dart Remvoe last few references to window singleton (#122644) 2023-03-15 00:34:34 +00:00
all_elements_test.dart
analysis_options.yaml
bindings_async_gap_test.dart
bindings_reset_test.dart TestWidgetsFlutterBinding should dispose old RestorationManager on reset. (#133999) 2023-09-07 17:49:33 -07:00
bindings_restoration_test.dart
bindings_test_failure.dart
bindings_test.dart Updates AutomatedTestWidgetsFlutterBinding.pump to support microsecond precision (#132401) 2023-08-14 23:24:47 +00:00
controller_test.dart Reland find.textRange.ofSubstring changes (#140469) 2023-12-20 22:00:55 +00:00
coordinate_translation_test.dart Remove LiveTestRenderView (#127882) 2023-06-02 20:41:05 +00:00
demangle_test.dart
display_test.dart Adds TestDisplay API for testing Display features (#127525) 2023-05-26 00:04:05 +00:00
event_simulation_test.dart Deprecate RawKeyEvent, RawKeyboard, et al. (#136677) 2023-12-11 22:19:18 +00:00
finders_test.dart Reland find.textRange.ofSubstring changes (#140469) 2023-12-20 22:00:55 +00:00
frame_timing_summarizer_test.dart
goldens_test.dart GoldenFileComparators should dispose created Image objects. (#136716) 2023-10-17 15:25:52 -07:00
integration_bindings_test.dart
live_binding_test.dart Remvoe last few references to window singleton (#122644) 2023-03-15 00:34:34 +00:00
live_widget_controller_test.dart Assert that runApp is called in the same zone as binding.ensureInitialized (#122836) 2023-03-16 22:33:09 +00:00
matchers_test.dart Add accessibility identifier to SemanticsProperties (#138331) 2023-12-11 18:03:07 +00:00
mock_canvas_test.dart Move mock canvas to flutter_test (#131631) 2023-08-07 23:43:03 +00:00
multi_view_accessibility_test.dart make FakeView not send Scene and semantics to the engine (#138849) 2023-11-22 20:48:20 +00:00
multi_view_controller_test.dart make FakeView not send Scene and semantics to the engine (#138849) 2023-11-22 20:48:20 +00:00
multi_view_testing.dart Prepare for dynamically sized views - pt. 2 (#139079) 2023-11-27 19:06:00 +00:00
platform_dispatcher_test.dart Add viewId to PointerEvents (#128287) 2023-06-06 19:16:02 -07:00
reference_image_test.dart Remove usage of testWidgetsWithLeakTracking. (#140239) 2023-12-15 14:13:31 -08:00
restoration_test.dart
stack_manipulation_test.dart
test_async_utils_test.dart Remove uses of deprecated test_api imports (#124732) 2023-04-20 20:55:28 +00:00
test_default_binary_messenger_test.dart [flutter_test] Adds method to mock EventChannels (#124415) 2023-04-10 17:02:48 +00:00
test_text_input_test.dart Add deleteBackwardByDecomposingPreviousCharacter mapping for tests (#132919) 2023-08-21 23:27:19 +00:00
view_test.dart Reapply "Dynamic view sizing" (#140165) (#140918) 2024-01-09 14:10:43 -08:00
widget_tester_leaks_test.dart Upgrade leak_tracker. (#141153) 2024-01-09 12:02:35 -08:00
widget_tester_live_device_test.dart Reapply "Dynamic view sizing" (#140165) (#140918) 2024-01-09 14:10:43 -08:00
widget_tester_test.dart Remove outdated ignores from tool (#140467) 2023-12-20 22:14:32 +00:00
window_test.dart Remove deprecated TestWindow.platformBrightnessTestValue/TestWindow.clearPlatformBrightnessTestValue (#133178) 2023-09-01 20:35:58 +00:00