Load assets in flutter_test without turning event loop.#115123
Merged
auto-submit[bot] merged 2 commits intoflutter:masterfrom Nov 11, 2022
Merged
Load assets in flutter_test without turning event loop.#115123auto-submit[bot] merged 2 commits intoflutter:masterfrom
auto-submit[bot] merged 2 commits intoflutter:masterfrom
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.
Contributor
Author
|
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. |
jonahwilliams
approved these changes
Nov 11, 2022
Contributor
jonahwilliams
left a comment
There was a problem hiding this comment.
LGTM (but not to CI)
Contributor
|
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 |
Contributor
Author
|
hah, I was wondering if that |
This was referenced Nov 11, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 11, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Nov 11, 2022
dnfield
added a commit
that referenced
this pull request
Nov 11, 2022
)" This reverts commit 88e49ed.
auto-submit bot
pushed a commit
to flutter/plugins
that referenced
this pull request
Nov 11, 2022
* 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)
stuartmorgan-g
pushed a commit
to flutter/packages
that referenced
this pull request
Nov 11, 2022
* 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)
dnfield
added a commit
to dnfield/flutter
that referenced
this pull request
Nov 11, 2022
…ter#115123)" (flutter#115156)" This reverts commit 3895786.
adam-harwood
pushed a commit
to adam-harwood/flutter_plugins
that referenced
this pull request
Nov 21, 2022
* 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)
shogohida
pushed a commit
to shogohida/flutter
that referenced
this pull request
Dec 7, 2022
* 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
shogohida
pushed a commit
to shogohida/flutter
that referenced
this pull request
Dec 7, 2022
…ter#115123)" (flutter#115156) This reverts commit 88e49ed.
shogohida
pushed a commit
to shogohida/flutter
that referenced
this pull request
Dec 7, 2022
…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.
gspencergoog
pushed a commit
to gspencergoog/flutter
that referenced
this pull request
Jan 19, 2023
* 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
gspencergoog
pushed a commit
to gspencergoog/flutter
that referenced
this pull request
Jan 19, 2023
…ter#115123)" (flutter#115156) This reverts commit 88e49ed.
gspencergoog
pushed a commit
to gspencergoog/flutter
that referenced
this pull request
Jan 19, 2023
…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.
mauricioluz
pushed a commit
to mauricioluz/plugins
that referenced
this pull request
Jan 26, 2023
* 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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.