Avoid generated plugin registrant warnings for scenario_app (flutter/engine#50874)

Cleans up some noise in those logs.
This commit is contained in:
Dan Field
2024-02-22 12:34:11 -08:00
committed by GitHub
parent d6735132e4
commit 8f527095b7
3 changed files with 16 additions and 6 deletions

View File

@@ -33,7 +33,13 @@ public class EngineLaunchE2ETest {
// Run the production under test on the UI thread instead of annotating the whole test
// as @UiThreadTest because having the message handler and the CompletableFuture both being
// on the same thread will create deadlocks.
UiThreadStatement.runOnUiThread(() -> engine.set(new FlutterEngine(applicationContext)));
UiThreadStatement.runOnUiThread(
() ->
engine.set(
new FlutterEngine(
applicationContext,
/*dartVmArgs */ null,
/* automaticallyRegisterPlugins */ false)));
SettableFuture<Boolean> statusReceived = SettableFuture.create();
// Resolve locale to `en_US`.

View File

@@ -16,14 +16,16 @@ public class SpawnMultiEngineActivity extends TestActivity {
@NonNull
public FlutterEngine provideFlutterEngine(@NonNull Context context) {
FlutterEngineGroup engineGroup = new FlutterEngineGroup(context);
FlutterEngine firstEngine = engineGroup.createAndRunDefaultEngine(context);
FlutterEngineGroup.Options options =
new FlutterEngineGroup.Options(context).setAutomaticallyRegisterPlugins(false);
FlutterEngine firstEngine = engineGroup.createAndRunEngine(options);
FlutterEngine secondEngine = engineGroup.createAndRunDefaultEngine(context);
FlutterEngine secondEngine = engineGroup.createAndRunEngine(options);
// Check that a new engine can be spawned from the group even if the group's
// original engine has been destroyed.
firstEngine.destroy();
FlutterEngine thirdEngine = engineGroup.createAndRunDefaultEngine(context);
FlutterEngine thirdEngine = engineGroup.createAndRunEngine(options);
return thirdEngine;
}

View File

@@ -16,9 +16,11 @@ public class SpawnedEngineActivity extends TestActivity {
@NonNull
public FlutterEngine provideFlutterEngine(@NonNull Context context) {
FlutterEngineGroup engineGroup = new FlutterEngineGroup(context);
engineGroup.createAndRunDefaultEngine(context);
FlutterEngineGroup.Options options =
new FlutterEngineGroup.Options(context).setAutomaticallyRegisterPlugins(false);
engineGroup.createAndRunEngine(options);
FlutterEngine secondEngine = engineGroup.createAndRunDefaultEngine(context);
FlutterEngine secondEngine = engineGroup.createAndRunEngine(options);
secondEngine
.getDartExecutor()