mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
In https://github.com/flutter/engine/pull/53280, I'm adding lifecycle-aware methods to `SurfaceProducer`. That means, in order to test that it WAI, we'll need to be running in a simulated activity, and be able to switch scenario states (i.e. to `RESUMED`). This was mentioned as well in https://github.com/flutter/flutter/issues/133151 as being something we want to do. This PR adds a `FlutterEngineRule`, which allows the creation of a "real" `FlutterEngine` and an `Intent` that can power `AndroidScenarioRule<FlutterActivity>`. I felt bad doing all of this work for a single `@Test`, so I also refactored the rest of the file and cleaned things up a bit. That said, I'm happy to revert or make changes if we liked how things were setup before.