This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Make it easy to write embedder unit tests by creating a fixture and config builder. #8276
Merged
Conversation
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
…onfig builder. All embedder unit-test have to setup the Flutter project arguments from scratch before launching the engine. The boilerplate and having to deal with the low level C API each engine launch is a hinderance to writing tests. This patch introduces EmbedderTest fixture that sets up all the embedder side snapshots before allowing the unit test to create a FlutterConfigBuilder that the test can use to incrementally build and edit the Flutter project configuration. From the given state state of a configuration, multiple engines can be launched with their lifecylces managed by appropriate RAII wrappers. This allows the a fully configured Flutter engine to be launched using 4 lines of code in a fixture. ``` EmbedderConfigBuilder builder; builder.SetSoftwareRendererConfig(); builder.SetAssetsPathFromFixture(this); builder.SetSnapshotsFromFixture(this); auto engine = builder.LaunchEngine(); ```
I'll convert the existing tests to use the fixture in a subsequent patch. |
jason-simmons
approved these changes
Mar 25, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Mar 25, 2019
…re and config builder. (flutter/engine#8276)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Mar 25, 2019
…re and config builder. (flutter/engine#8276)
engine-flutter-autoroll
added a commit
to flutter/flutter
that referenced
this pull request
Mar 25, 2019
flutter/engine@3a445ce...dd6be2f git log 3a445ce..dd6be2f --no-merges --oneline dd6be2f Roll src/third_party/skia 42197c0bc68e..15dc59e65cfa (19 commits) (flutter/engine#8294) d6ead18 Make it easy to write embedder unit tests by creating a fixture and config builder. (flutter/engine#8276) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff (liyuqian@google.com), and stop the roller if necessary.
RBogie
pushed a commit
to RBogie/flutter-engine
that referenced
this pull request
Apr 8, 2019
…onfig builder. (flutter#8276) All embedder unit-tests have to setup the Flutter project arguments from scratch before launching the engine. The boilerplate and having to deal with the low level C API during each engine launch is a hinderance to writing tests. This patch introduces an EmbedderTest fixture that sets up all the embedder side snapshots before allowing the unit test to create a FlutterConfigBuilder` that the test can use to incrementally build and edit the Flutter project configuration. From the given state state of a configuration, multiple engines can be launched with their lifecylces managed by appropriate RAII wrappers. This allows the a fully configured Flutter engine to be launched using 4 lines of code in a fixture. ``` EmbedderConfigBuilder builder; builder.SetSoftwareRendererConfig(); builder.SetAssetsPathFromFixture(this); builder.SetSnapshotsFromFixture(this); auto engine = builder.LaunchEngine(); ```
RBogie
added a commit
to RBogie/flutter-engine
that referenced
this pull request
Apr 8, 2019
…re and config builder. (flutter#8276)" This reverts commit 2ccc33a.
RBogie
added a commit
to RBogie/flutter-engine
that referenced
this pull request
Apr 8, 2019
…re and config builder. (flutter#8276)" This reverts commit 2ccc33a.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
All embedder unit-tests have to setup the Flutter project arguments from scratch
before launching the engine. The boilerplate and having to deal with the low
level C API during each engine launch is a hinderance to writing tests.
This patch introduces an
EmbedderTest fixture that sets up all the embedder side snapshots before allowing the unit test to create a
FlutterConfigBuilder` thatthe test can use to incrementally build and edit the Flutter project
configuration. From the given state state of a configuration, multiple engines
can be launched with their lifecylces managed by appropriate RAII wrappers.
This allows the a fully configured Flutter engine to be launched using 4 lines
of code in a fixture.