This change adds the following events: - `widget_preview.initializing`: sent immediately after the widget previewer starts. This event includes the PID of the process starting the widget previewer for use by tooling to explicitly kill the tool process. - `widget_preview.logMessage`: sent for calls to `Logger` methods when in machine mode. This follows the same format as `daemon.logMessage`. This change also fixes and improves testing of `WidgetPreviewMachineAwareLogger` in `widget_preview_machine_test.dart` as the existing test validator did not cause tests to fail correctly. Fixes https://github.com/flutter/flutter/issues/175002
Integration tests
These tests are not hermetic, and use the actual Flutter SDK. While
they don't require actual devices, they run flutter_tester to test
Dart VM and Flutter integration.
Use this command to run (from the flutter_tools directory):
../../bin/cache/dart-sdk/bin/dart run test test/integration.shard
You need to have downloaded the Dart SDK in your Flutter clone for this
to work. Running ../../bin/flutter will automatically download it.
Coverage exclusion
These tests are expensive to run and do not give meaningful coverage
information for the flutter tool (since they are black-box tests that
run the tool as a subprocess, rather than being unit tests). For this
reason, they are in a separate shard when running on continuous
integration and are not run when calculating coverage.
Adding new test files
When adding a new test file make sure that it ends with _test.dart, or else it will not be run.