Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[macOS] Clean up resources in ViewController tests
Wraps all FlutterViewController tests in an autorelease pool to ensure resources are cleaned up. Adds a MockFlutterEngineTest subclass of AutoreleasePoolTest that creates an OCPartialMock FlutterEngine and shuts it down at the end of the test. Previously we were not shutting down any FlutterEngine instances we allocated, resulting in potentially thousands of threads and graphics contexts being allocated. Prior to this change, running these tests via: ../out/host_debug_unopt_arm64/flutter_desktop_darwin_unittests \ --gtest_filter='FlutterViewController.*' --gtest_repeat=1000 resulted in test failures and sometimes segfaults. This ensures resources are cleaned up Eventually all unit tests should configure their FlutterEngine via either FlutterEngineTest (which should be an AutoreleasePoolTest) or MockFlutterEngineTest, and the CreateMockFlutterEngine function moved to a static used in the implementation of these. Issue: flutter/flutter#104789 Issue: flutter/flutter#127441 Issue: flutter/flutter#124840
- Loading branch information