-
Notifications
You must be signed in to change notification settings - Fork 29.1k
Load assets in flutter_test without turning event loop. #115123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This makes it possible to load an asset without actually turning the event loop. This is importnat because our FakeAsync zones may cause people to sprinkle in extra pumpAndSettles in when running tests that load assets, which is undesirable.
I came across this because I'm working on rolling a new version of flutter_svg into Google's monorepo. Tests in there that previously worked because of google-specific magic now are missing assets because the rewrite assumes you can do this kind of thing synchronously in a test. I'd like to get rid of all flutter_svg specific magic from test harnesses if possible. |
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.
LGTM (but not to CI)
I think if we can stick this change, i can delete the fake asset manager entirely and use the real one. Will need to experiment on my own |
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.
LGTM
hah, I was wondering if that |
)" This reverts commit 88e49ed.
* bdcacbf 1c1ad0e72 Roll Fuchsia Linux SDK from RNSA2Wp1MObtc7OHy... to mduclAELKkftJ-fwI... (flutter/engine#37495) (flutter/flutter#115088) * ca61652 Roll ios-deploy iOS artifact (flutter/flutter#115042) * b31b9dc 057c53a05 [Impeller] Remove duplicate code in 'TiledTextureContents' (flutter/engine#37492) (flutter/flutter#115093) * 19b351b f467eee51 Turned on performance-move-const-arg everywhere. (flutter/engine#37482) (flutter/flutter#115095) * 5a60045 Reland: Adds support for the Material Badge widget, BadgeTheme, BadgeThemeData (#114560) (flutter/flutter#115002) * 09a4f23 Prevent tests from producing dill files alongside the test file (flutter/flutter#115075) * 1f891a0 Fix `RangeSlider` semantics node size (flutter/flutter#114999) * c1ceda4 Include stdout in codesign failure output (flutter/flutter#115115) * 2e432ec chore: enable Flutter Android workflow on aarch64 (flutter/flutter#113829) * ad72a45 12dabe83d Felt analyze (flutter/engine#37481) (flutter/flutter#115102) * 4e7dbef Explicitly call out documentation links in "flutter create" (flutter/flutter#114181) * d413081 Fix shrinkwrap on animated list (flutter/flutter#115104) * bd00a93 Roll Flutter Engine from 12dabe83da19 to 4cb9c1e00a84 (5 revisions) (flutter/flutter#115118) * 8858c17 Roll Flutter Engine from 4cb9c1e00a84 to 30e2cedfa2ac (2 revisions) (flutter/flutter#115122) * 0f2f4b8 Roll Flutter Engine from 30e2cedfa2ac to cae1716611a4 (2 revisions) (flutter/flutter#115124) * c6561e6 53cfb94c5 Roll Skia from 65b60707772d to b50a2f714837 (46 revisions) (flutter/engine#37501) (flutter/flutter#115128) * 6e89042 0721c860e [Impeller] null check samplers (flutter/engine#37489) (flutter/flutter#115132) * 88e49ed Load assets in flutter_test without turning event loop. (flutter/flutter#115123) * f997281 Roll Flutter Engine from 0721c860e2c3 to cb78576e5fec (3 revisions) (flutter/flutter#115134) * 0d081f9 Roll Flutter Engine from cb78576e5fec to a41712cec63a (2 revisions) (flutter/flutter#115135) * 83cda7e 19ead2834 Roll Fuchsia Linux SDK from mduclAELKkftJ-fwI... to R3L54Ma3VT2TQ6RpI... (flutter/engine#37513) (flutter/flutter#115139) * c021d91 [flutter_tools] support github reporter (flutter/flutter#115137) * 413bb21 e32fc0044 Roll Skia from b50f741ef341 to 77620568f467 (5 revisions) (flutter/engine#37514) (flutter/flutter#115142) * 098aac7 7326e5b33 Roll Dart SDK from 3a022103e91d to 1e37edb1f6c1 (1 revision) (flutter/engine#37515) (flutter/flutter#115145)
* 19b351b f467eee51 Turned on performance-move-const-arg everywhere. (flutter/engine#37482) (flutter/flutter#115095) * 5a60045 Reland: Adds support for the Material Badge widget, BadgeTheme, BadgeThemeData (#114560) (flutter/flutter#115002) * 09a4f23 Prevent tests from producing dill files alongside the test file (flutter/flutter#115075) * 1f891a0 Fix `RangeSlider` semantics node size (flutter/flutter#114999) * c1ceda4 Include stdout in codesign failure output (flutter/flutter#115115) * 2e432ec chore: enable Flutter Android workflow on aarch64 (flutter/flutter#113829) * ad72a45 12dabe83d Felt analyze (flutter/engine#37481) (flutter/flutter#115102) * 4e7dbef Explicitly call out documentation links in "flutter create" (flutter/flutter#114181) * d413081 Fix shrinkwrap on animated list (flutter/flutter#115104) * bd00a93 Roll Flutter Engine from 12dabe83da19 to 4cb9c1e00a84 (5 revisions) (flutter/flutter#115118) * 8858c17 Roll Flutter Engine from 4cb9c1e00a84 to 30e2cedfa2ac (2 revisions) (flutter/flutter#115122) * 0f2f4b8 Roll Flutter Engine from 30e2cedfa2ac to cae1716611a4 (2 revisions) (flutter/flutter#115124) * c6561e6 53cfb94c5 Roll Skia from 65b60707772d to b50a2f714837 (46 revisions) (flutter/engine#37501) (flutter/flutter#115128) * 6e89042 0721c860e [Impeller] null check samplers (flutter/engine#37489) (flutter/flutter#115132) * 88e49ed Load assets in flutter_test without turning event loop. (flutter/flutter#115123) * f997281 Roll Flutter Engine from 0721c860e2c3 to cb78576e5fec (3 revisions) (flutter/flutter#115134) * 0d081f9 Roll Flutter Engine from cb78576e5fec to a41712cec63a (2 revisions) (flutter/flutter#115135) * 83cda7e 19ead2834 Roll Fuchsia Linux SDK from mduclAELKkftJ-fwI... to R3L54Ma3VT2TQ6RpI... (flutter/engine#37513) (flutter/flutter#115139) * c021d91 [flutter_tools] support github reporter (flutter/flutter#115137) * 413bb21 e32fc0044 Roll Skia from b50f741ef341 to 77620568f467 (5 revisions) (flutter/engine#37514) (flutter/flutter#115142) * 098aac7 7326e5b33 Roll Dart SDK from 3a022103e91d to 1e37edb1f6c1 (1 revision) (flutter/engine#37515) (flutter/flutter#115145)
…ter#115123)" (flutter#115156)" This reverts commit 3895786.
* bdcacbf 1c1ad0e72 Roll Fuchsia Linux SDK from RNSA2Wp1MObtc7OHy... to mduclAELKkftJ-fwI... (flutter/engine#37495) (flutter/flutter#115088) * ca61652 Roll ios-deploy iOS artifact (flutter/flutter#115042) * b31b9dc 057c53a05 [Impeller] Remove duplicate code in 'TiledTextureContents' (flutter/engine#37492) (flutter/flutter#115093) * 19b351b f467eee51 Turned on performance-move-const-arg everywhere. (flutter/engine#37482) (flutter/flutter#115095) * 5a60045 Reland: Adds support for the Material Badge widget, BadgeTheme, BadgeThemeData (#114560) (flutter/flutter#115002) * 09a4f23 Prevent tests from producing dill files alongside the test file (flutter/flutter#115075) * 1f891a0 Fix `RangeSlider` semantics node size (flutter/flutter#114999) * c1ceda4 Include stdout in codesign failure output (flutter/flutter#115115) * 2e432ec chore: enable Flutter Android workflow on aarch64 (flutter/flutter#113829) * ad72a45 12dabe83d Felt analyze (flutter/engine#37481) (flutter/flutter#115102) * 4e7dbef Explicitly call out documentation links in "flutter create" (flutter/flutter#114181) * d413081 Fix shrinkwrap on animated list (flutter/flutter#115104) * bd00a93 Roll Flutter Engine from 12dabe83da19 to 4cb9c1e00a84 (5 revisions) (flutter/flutter#115118) * 8858c17 Roll Flutter Engine from 4cb9c1e00a84 to 30e2cedfa2ac (2 revisions) (flutter/flutter#115122) * 0f2f4b8 Roll Flutter Engine from 30e2cedfa2ac to cae1716611a4 (2 revisions) (flutter/flutter#115124) * c6561e6 53cfb94c5 Roll Skia from 65b60707772d to b50a2f714837 (46 revisions) (flutter/engine#37501) (flutter/flutter#115128) * 6e89042 0721c860e [Impeller] null check samplers (flutter/engine#37489) (flutter/flutter#115132) * 88e49ed Load assets in flutter_test without turning event loop. (flutter/flutter#115123) * f997281 Roll Flutter Engine from 0721c860e2c3 to cb78576e5fec (3 revisions) (flutter/flutter#115134) * 0d081f9 Roll Flutter Engine from cb78576e5fec to a41712cec63a (2 revisions) (flutter/flutter#115135) * 83cda7e 19ead2834 Roll Fuchsia Linux SDK from mduclAELKkftJ-fwI... to R3L54Ma3VT2TQ6RpI... (flutter/engine#37513) (flutter/flutter#115139) * c021d91 [flutter_tools] support github reporter (flutter/flutter#115137) * 413bb21 e32fc0044 Roll Skia from b50f741ef341 to 77620568f467 (5 revisions) (flutter/engine#37514) (flutter/flutter#115142) * 098aac7 7326e5b33 Roll Dart SDK from 3a022103e91d to 1e37edb1f6c1 (1 revision) (flutter/engine#37515) (flutter/flutter#115145)
* Load assets in flutter_test without turning event loop. This makes it possible to load an asset without actually turning the event loop. This is importnat because our FakeAsync zones may cause people to sprinkle in extra pumpAndSettles in when running tests that load assets, which is undesirable. * fix null checking
…ter#115123)" (flutter#115156) This reverts commit 88e49ed.
…nousFuture usage in test assets (flutter#115173) * Make FutureBuilder handle SynchronousFuture correctly * Reland "Load assets in flutter_test without turning event loop. (flutter#115123)" (flutter#115156)" This reverts commit 3895786.
* Load assets in flutter_test without turning event loop. This makes it possible to load an asset without actually turning the event loop. This is importnat because our FakeAsync zones may cause people to sprinkle in extra pumpAndSettles in when running tests that load assets, which is undesirable. * fix null checking
…ter#115123)" (flutter#115156) This reverts commit 88e49ed.
…nousFuture usage in test assets (flutter#115173) * Make FutureBuilder handle SynchronousFuture correctly * Reland "Load assets in flutter_test without turning event loop. (flutter#115123)" (flutter#115156)" This reverts commit 3895786.
* bdcacbf 1c1ad0e72 Roll Fuchsia Linux SDK from RNSA2Wp1MObtc7OHy... to mduclAELKkftJ-fwI... (flutter/engine#37495) (flutter/flutter#115088) * ca61652 Roll ios-deploy iOS artifact (flutter/flutter#115042) * b31b9dc 057c53a05 [Impeller] Remove duplicate code in 'TiledTextureContents' (flutter/engine#37492) (flutter/flutter#115093) * 19b351b f467eee51 Turned on performance-move-const-arg everywhere. (flutter/engine#37482) (flutter/flutter#115095) * 5a60045 Reland: Adds support for the Material Badge widget, BadgeTheme, BadgeThemeData (#114560) (flutter/flutter#115002) * 09a4f23 Prevent tests from producing dill files alongside the test file (flutter/flutter#115075) * 1f891a0 Fix `RangeSlider` semantics node size (flutter/flutter#114999) * c1ceda4 Include stdout in codesign failure output (flutter/flutter#115115) * 2e432ec chore: enable Flutter Android workflow on aarch64 (flutter/flutter#113829) * ad72a45 12dabe83d Felt analyze (flutter/engine#37481) (flutter/flutter#115102) * 4e7dbef Explicitly call out documentation links in "flutter create" (flutter/flutter#114181) * d413081 Fix shrinkwrap on animated list (flutter/flutter#115104) * bd00a93 Roll Flutter Engine from 12dabe83da19 to 4cb9c1e00a84 (5 revisions) (flutter/flutter#115118) * 8858c17 Roll Flutter Engine from 4cb9c1e00a84 to 30e2cedfa2ac (2 revisions) (flutter/flutter#115122) * 0f2f4b8 Roll Flutter Engine from 30e2cedfa2ac to cae1716611a4 (2 revisions) (flutter/flutter#115124) * c6561e6 53cfb94c5 Roll Skia from 65b60707772d to b50a2f714837 (46 revisions) (flutter/engine#37501) (flutter/flutter#115128) * 6e89042 0721c860e [Impeller] null check samplers (flutter/engine#37489) (flutter/flutter#115132) * 88e49ed Load assets in flutter_test without turning event loop. (flutter/flutter#115123) * f997281 Roll Flutter Engine from 0721c860e2c3 to cb78576e5fec (3 revisions) (flutter/flutter#115134) * 0d081f9 Roll Flutter Engine from cb78576e5fec to a41712cec63a (2 revisions) (flutter/flutter#115135) * 83cda7e 19ead2834 Roll Fuchsia Linux SDK from mduclAELKkftJ-fwI... to R3L54Ma3VT2TQ6RpI... (flutter/engine#37513) (flutter/flutter#115139) * c021d91 [flutter_tools] support github reporter (flutter/flutter#115137) * 413bb21 e32fc0044 Roll Skia from b50f741ef341 to 77620568f467 (5 revisions) (flutter/engine#37514) (flutter/flutter#115142) * 098aac7 7326e5b33 Roll Dart SDK from 3a022103e91d to 1e37edb1f6c1 (1 revision) (flutter/engine#37515) (flutter/flutter#115145)
This makes it possible to load an asset without actually turning the event loop. This is importnat because our FakeAsync zones may cause people to sprinkle in extra pumpAndSettles in when running tests that load assets, which is undesirable.
While I was here I noticed some unnecessary dynamic usage in SynchronousFuture.