Use "headless" flag in web tests for LUCI (#10075)
diff --git a/packages/devtools_app/integration_test/test_infra/run/_test_app_driver.dart b/packages/devtools_app/integration_test/test_infra/run/_test_app_driver.dart
index 4906fae..95e2582 100644
--- a/packages/devtools_app/integration_test/test_infra/run/_test_app_driver.dart
+++ b/packages/devtools_app/integration_test/test_infra/run/_test_app_driver.dart
@@ -15,7 +15,12 @@
   TestFlutterApp({
     String appPath = 'test/test_infra/fixtures/flutter_app',
     TestAppDevice appDevice = TestAppDevice.flutterTester,
-  }) : super(appPath, appDevice);
+    bool headless = false,
+  }) : _headless = headless,
+       super(appPath, appDevice);
+
+  /// Whether to run web tests headlessly.
+  final bool _headless;
 
   String? _currentRunningAppId;
 
@@ -30,6 +35,8 @@
         testAppDevice.argName,
         // Do not serve DevTools from Flutter Tools.
         '--no-devtools',
+        if (_headless && testAppDevice == TestAppDevice.flutterChrome)
+          '--web-run-headless',
       ],
       workingDirectory: testAppPath,
     );
diff --git a/packages/devtools_app/integration_test/test_infra/run/run_test.dart b/packages/devtools_app/integration_test/test_infra/run/run_test.dart
index e815316..39c2c2c 100644
--- a/packages/devtools_app/integration_test/test_infra/run/run_test.dart
+++ b/packages/devtools_app/integration_test/test_infra/run/run_test.dart
@@ -58,6 +58,7 @@
           testApp = TestFlutterApp(
             appPath: testFileArgs.appPath,
             appDevice: testRunnerArgs.testAppDevice,
+            headless: testRunnerArgs.headless,
           );
         }
         debugLog('starting the test app');