Repository: flutter
Issue: Semantics produces illegible errors in non-debug builds when test fakes text input
Labels: a: text input,platform-web,a: error message,f: integration_test,has reproducible steps,P3,found in release: 2.5,found in release: 2.6,customer: dent,team-web,triaged-web

When running an integration test that interacts with a TextField, multiple errors get thrown from the framework that cause the test to fail. Note that this only happens when not running with the default `--debug` flag (meaning running with `--release` or `--profile`) but we do not want to run our integration tests in `--debug` mode as we'd like the tests to accurately portray behavior in the "real" environment.

I first ran with `-d web-server` as instructed [here](https://flutter.dev/docs/cookbook/testing/integration/introduction#5b-web)

Terminal Command: `flutter drive --driver=int_test/util/flutter_driver.dart --target=int_test/my_int_test.dart -d web-server --profile --keep-app-running`
Terminal Output:
```
Running "flutter pub get" in flutter_int_test_on_web...            750ms
Launching int_test/my_int_test.dart on Web Server in profile mode...
Compiling int_test/my_int_test.dart for the Web...                 30.9s
int_test/my_int_test.dart is being served at http://localhost:63807
The web-server device requires the Dart Debug Chrome extension for debugging. Consider using the Chrome or Edge devices for an improved development workflow.
[INFO]: http://localhost:63807/ 64:26 "Installed new service worker."
[INFO]: http://localhost:63807/main.dart.js 15661:16 "00:00 +0: test example"
Failure Details:
Failure in method: test example

end of failure 1



Leaving the application running.
```
Chromium Console Output: Chromium never even opens

I noticed the error message "The web-server device requires the Dart Debug Chrome extension for debugging. Consider using the Chrome or Edge devices for an improved development workflow." even though I have downloaded the [Dart Debug Extension](https://chrome.google.com/webstore/detail/dart-debug-extension/eljbmlghnomdjgdjmbdekegdkbabckhm). I then tried removing `-d web-server`.


Terminal Command: `flutter drive --driver=int_test/util/flutter_driver.dart --target=int_test/my_int_test.dart --profile --keep-app-running`
Terminal Output:
```
Running "flutter pub get" in flutter_int_test_on_web...            757ms
Launching int_test/my_int_test.dart on Chrome in profile mode...
Compiling int_test/my_int_test.dart for the Web...                 30.0s
[INFO]: http://localhost:64557/ 64:26 "Installed new service worker."
[INFO]: http://localhost:64557/main.dart.js 15661:16 "00:00 +0: test example"
Failure Details:
Failure in method: test example

end of failure 1



Leaving the application running.
```
Chromium Console Output: 
```
(index):65 Installed new service worker.
js_primitives.dart:47 00:00 +0: test example
js_primitives.dart:47 NoSuchMethodError: method not found: 'activate$1' on null
js_primitives.dart:47     at TextField.update$0 (http://localhost:64557/main.dart.js:46871:52)
js_primitives.dart:47     at SemanticsObject._updateRole$2 (http://localhost:64557/main.dart.js:46051:17)
js_primitives.dart:47     at EngineSemanticsOwner.updateSemantics$1 (http://localhost:64557/main.dart.js:46475:16)
js_primitives.dart:47     at TestWindow.updateSemantics$1 (http://localhost:64557/main.dart.js:115790:89)
js_primitives.dart:47     at SemanticsOwner.sendSemanticsUpdate$0 (http://localhost:64557/main.dart.js:94093:25)
js_primitives.dart:47     at PipelineOwner.flushSemantics$0 (http://localhost:64557/main.dart.js:88683:31)
js_primitives.dart:47     at IntegrationTestWidgetsFlutterBinding.drawFrame$0 (http://localhost:64557/main.dart.js:84460:36)
js_primitives.dart:47     at IntegrationTestWidgetsFlutterBinding.drawFrame$0 (http://localhost:64557/main.dart.js:114541:15)
js_primitives.dart:47     at IntegrationTestWidgetsFlutterBinding._handlePersistentFrameCallback$1 (http://localhost:64557/main.dart.js:84433:12)
js_primitives.dart:47     at Object.eval (eval at Closure_forwardCallTo (http://localhost:64557/main.dart.js:13482:14), <anonymous>:3:44)
js_primitives.dart:47 NoSuchMethodError: method not found: 'setEditingState$1' on null
js_primitives.dart:47     at TextField.update$0 (http://localhost:64557/main.dart.js:46877:50)
js_primitives.dart:47     at SemanticsObject._updateRole$2 (http://localhost:64557/main.dart.js:46051:17)
js_primitives.dart:47     at EngineSemanticsOwner.updateSemantics$1 (http://localhost:64557/main.dart.js:46475:16)
js_primitives.dart:47     at TestWindow.updateSemantics$1 (http://localhost:64557/main.dart.js:115790:89)
js_primitives.dart:47     at SemanticsOwner.sendSemanticsUpdate$0 (http://localhost:64557/main.dart.js:94093:25)
js_primitives.dart:47     at PipelineOwner.flushSemantics$0 (http://localhost:64557/main.dart.js:88683:31)
js_primitives.dart:47     at IntegrationTestWidgetsFlutterBinding.drawFrame$0 (http://localhost:64557/main.dart.js:84460:36)
js_primitives.dart:47     at IntegrationTestWidgetsFlutterBinding.drawFrame$0 (http://localhost:64557/main.dart.js:114541:15)
js_primitives.dart:47     at IntegrationTestWidgetsFlutterBinding._handlePersistentFrameCallback$1 (http://localhost:64557/main.dart.js:84433:12)
js_primitives.dart:47     at Object.eval (eval at Closure_forwardCallTo (http://localhost:64557/main.dart.js:13482:14), <anonymous>:3:44)
js_primitives.dart:47 NoSuchMethodError: method not found: 'setEditingState$1' on null
js_primitives.dart:47     at TextField.update$0 (http://localhost:64557/main.dart.js:46877:50)
js_primitives.dart:47     at SemanticsObject._updateRole$2 (http://localhost:64557/main.dart.js:46051:17)
js_primitives.dart:47     at EngineSemanticsOwner.updateSemantics$1 (http://localhost:64557/main.dart.js:46475:16)
js_primitives.dart:47     at TestWindow.updateSemantics$1 (http://localhost:64557/main.dart.js:115790:89)
js_primitives.dart:47     at SemanticsOwner.sendSemanticsUpdate$0 (http://localhost:64557/main.dart.js:94093:25)
js_primitives.dart:47     at PipelineOwner.flushSemantics$0 (http://localhost:64557/main.dart.js:88683:31)
js_primitives.dart:47     at IntegrationTestWidgetsFlutterBinding.drawFrame$0 (http://localhost:64557/main.dart.js:84460:36)
js_primitives.dart:47     at IntegrationTestWidgetsFlutterBinding.drawFrame$0 (http://localhost:64557/main.dart.js:114541:15)
js_primitives.dart:47     at IntegrationTestWidgetsFlutterBinding._handlePersistentFrameCallback$1 (http://localhost:64557/main.dart.js:84433:12)
js_primitives.dart:47     at Object.eval (eval at Closure_forwardCallTo (http://localhost:64557/main.dart.js:13482:14), <anonymous>:3:44)
js_primitives.dart:47 NoSuchMethodError: method not found: 'setEditingState$1' on null
js_primitives.dart:47     at TextField.update$0 (http://localhost:64557/main.dart.js:46877:50)
js_primitives.dart:47     at SemanticsObject._updateRole$2 (http://localhost:64557/main.dart.js:46051:17)
js_primitives.dart:47     at EngineSemanticsOwner.updateSemantics$1 (http://localhost:64557/main.dart.js:46475:16)
js_primitives.dart:47     at TestWindow.updateSemantics$1 (http://localhost:64557/main.dart.js:115790:89)
js_primitives.dart:47     at SemanticsOwner.sendSemanticsUpdate$0 (http://localhost:64557/main.dart.js:94093:25)
js_primitives.dart:47     at PipelineOwner.flushSemantics$0 (http://localhost:64557/main.dart.js:88683:31)
js_primitives.dart:47     at IntegrationTestWidgetsFlutterBinding.drawFrame$0 (http://localhost:64557/main.dart.js:84460:36)
js_primitives.dart:47     at IntegrationTestWidgetsFlutterBinding.drawFrame$0 (http://localhost:64557/main.dart.js:114541:15)
js_primitives.dart:47     at IntegrationTestWidgetsFlutterBinding._handlePersistentFrameCallback$1 (http://localhost:64557/main.dart.js:84433:12)
js_primitives.dart:47     at Object.eval (eval at Closure_forwardCallTo (http://localhost:64557/main.dart.js:13482:14), <anonymous>:3:44)
js_primitives.dart:47 NoSuchMethodError: method not found: 'setEditingState$1' on null
js_primitives.dart:47     at TextField.update$0 (http://localhost:64557/main.dart.js:46877:50)
js_primitives.dart:47     at SemanticsObject._updateRole$2 (http://localhost:64557/main.dart.js:46051:17)
js_primitives.dart:47     at EngineSemanticsOwner.updateSemantics$1 (http://localhost:64557/main.dart.js:46475:16)
js_primitives.dart:47     at TestWindow.updateSemantics$1 (http://localhost:64557/main.dart.js:115790:89)
js_primitives.dart:47     at SemanticsOwner.sendSemanticsUpdate$0 (http://localhost:64557/main.dart.js:94093:25)
js_primitives.dart:47     at PipelineOwner.flushSemantics$0 (http://localhost:64557/main.dart.js:88683:31)
js_primitives.dart:47     at IntegrationTestWidgetsFlutterBinding.drawFrame$0 (http://localhost:64557/main.dart.js:84460:36)
js_primitives.dart:47     at IntegrationTestWidgetsFlutterBinding.drawFrame$0 (http://localhost:64557/main.dart.js:114541:15)
js_primitives.dart:47     at IntegrationTestWidgetsFlutterBinding._handlePersistentFrameCallback$1 (http://localhost:64557/main.dart.js:84433:12)
js_primitives.dart:47     at Object.eval (eval at Closure_forwardCallTo (http://localhost:64557/main.dart.js:13482:14), <anonymous>:3:44)
js_primitives.dart:47 Multiple exceptions (5) were detected during the running of the current test, and at least one was unexpected.
js_primitives.dart:47     at Object.StackTrace_current (http://localhost:64557/main.dart.js:23602:40)
js_primitives.dart:47     at Object.debugPrintStack (http://localhost:64557/main.dart.js:30060:99)
js_primitives.dart:47     at Object.FlutterError_dumpErrorToConsole (http://localhost:64557/main.dart.js:29982:11)
js_primitives.dart:47     at StaticClosure._defaultTestExceptionReporter (http://localhost:64557/main.dart.js:26692:9)
js_primitives.dart:47     at IntegrationTestWidgetsFlutterBinding_closure0.call$2 (http://localhost:64557/main.dart.js:116191:37)
js_primitives.dart:47     at TestWidgetsFlutterBinding__createTestCompletionHandler_closure.call$0 (http://localhost:64557/main.dart.js:113673:12)
js_primitives.dart:47     at StaticClosure._rootRun (http://localhost:64557/main.dart.js:22132:18)
js_primitives.dart:47     at _CustomZone.run$1$1 (http://localhost:64557/main.dart.js:57744:39)
js_primitives.dart:47     at _Future__propagateToListeners_handleWhenCompleteCallback.call$0 (http://localhost:64557/main.dart.js:56923:42)
js_primitives.dart:47     at Object._Future__propagateToListeners (http://localhost:64557/main.dart.js:21923:102)
js_primitives.dart:47 00:30 +0: test example [E]
js_primitives.dart:47   Test failed. See exception logs above.
  The test description was: test example
js_primitives.dart:47   
js_primitives.dart:47 Consider enabling the flag chain-stack-traces to receive more detailed exceptions.
For example, 'dart test --chain-stack-traces'.
js_primitives.dart:47 00:30 +0 -1: (tearDownAll)
js_primitives.dart:47 00:30 +1 -1: Some tests failed.
```

Test Repo: https://www.github.com/JordanRoberts1/flutter_int_test_on_web

Running [chrome driver version 94.0.4606.61](https://chromedriver.storage.googleapis.com/index.html?path=94.0.4606.61/) with `./int_test/util/chromedriver --port=4444

Flutter doctor: 
```
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.5.2, on macOS 11.6 20G165 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✗] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.2.2)
[✓] VS Code (version 1.49.3)
[✓] Connected device (1 available)

! Doctor found issues in 1 category.
```

Lastly, resolving the above exceptions thrown is the most important, but I have also noticed that the Terminal Output matches the Chromium Console Output when running `--debug` but not for `--profile` or `--release`. What is the reason for this? I do not see how it would be unuseful to be able to see all output in the terminal regardless of build type.

EDIT: updated test repo web address