1. 17 May, 2022 7 commits
    • Chris Bracken's avatar
      [tool] Consistent FakeProcessManager.run/runSync (#103947) · 928bb122
      Chris Bracken authored
      `FakeProcessManager` is a test-oriented implementation of `ProcessManager`
      that simulates launching processes and returning `ProcessResult` objects
      whose `exitCode`, `stdout`, `stderr` can be used to write platform-portable,
      hermetic tests that don't rely on actually launching processes from
      executables on disk. Its `run` and `runSync` methods provide asynchronous and
      synchronous variants of this functionality.
      
      Previously, the behaviour of `run` and `runSync` were inconsistent with
      regards to the treatment of the `stdoutEncoding` (similarly,
      `stderrEncoding`) parameters:
      
      `run`:
      * if the encoding was null, `ProcessResult.stdout` was returned as a
        String in UTF-8 encoding. This was incorrect. The behaviour as
        specified in `ProcessResult.stdout` is that in this case, a raw
        `List<int>` should be returned.
      * If the encoding was unspecified, `ProcessResult.stdout` was returned as
        a `String` in the `io.systemEncoding` encoding. This was correct.
      * If the encoding was non-null, `ProcessResult.stdout` was returned as a
        `String` in the specified encoding. This was correct.
      
      `runSync`:
      * if the encoding was null, `ProcessResult.stdout` was returned as a
        `List<int>` in UTF-8 encoding. This was incorrect. The behaviour as
        specified in `ProcessResult.stdout` is that in this case, a raw
        `List<int>` should be returned.
      * If the encoding was unspecified, `ProcessResult.stdout` was returned as
        `List<int>` in UTF-8 encoding. This was incorrect. The behaviour as
        specified in `ProcessResult.stdout` is that in this case, a String a
        `String` in the `io.systemEncoding` encoding should be returned.
      * if the encoding was non-null, `ProcessResult.stdout` was returned as a
        `String` in unknown (but probably UTF-8) encoding. This was incorrect.
        The behaviour as specified in `ProcessResult.stdout` is that in this
        case, a `String` in the specified encoding should be returned.
      
      `_FakeProcess`, from which we obtain the fake stdout and stderr values now
      holds these fields as raw `List<int>` of bytes rather than as `String`s. It
      is up to the user to supply values that can be decoded with the encoding
      passed to `run`/`runAsync`.
      
      `run` and `runAsync` have been updated to set stdout (likewise, stderr) as
      specified in the `ProcessResult` documentation.
      
      This is pre-factoring for #102451, in which the tool throws an exception
      when processing the JSON output from stdout of the `vswhere.exe` tool,
      whose output was found to include the `U+FFFD` Unicode replacement
      character during UTF-8 decoding, which triggers a `toolExit` exception
      when decoded using our [Utf8Decoder][decoder] configured with `reportErrors` =
      true. Because `FakeProcessManager.runAsync` did not previously invoke
      `utf8.decode` on its output (behaviour which differs from the non-fake
      implementation), it was impossible to write tests to verify the fix.
      
      Ref: https://api.flutter.dev/flutter/dart-io/ProcessResult/stdout.html
      
      Issue: https://github.com/flutter/flutter/issues/102451
      
      [decoder]: https://github.com/flutter/flutter/blob/fd312f1ccff909fde28d2247a489bf210bbc6c48/packages/flutter_tools/lib/src/convert.dart#L51-L60
      928bb122
    • Greg Spencer's avatar
      Add VoidCallbackAction and VoidCallbackIntent (#103518) · 19940279
      Greg Spencer authored
      This adds a simple VoidCallbackAction and VoidCallbackIntent that allows configuring an intent that will invoke a void callback when the intent is sent to the action subsystem. This allows binding a shortcut directly to a void callback in a Shortcuts widget.
      
      I also added an instance of VoidCallbackAction to the default actions so that simply binding a shortcut to a VoidCallbackIntent works anywhere in the app, and you don't need to add a VoidCallbackAction at the top of your app to make it work.
      19940279
    • engine-flutter-autoroll's avatar
    • engine-flutter-autoroll's avatar
    • engine-flutter-autoroll's avatar
    • Jenn Magder's avatar
      Up CocoaPods minumum to 1.10 (#103655) · bf7a3262
      Jenn Magder authored
      bf7a3262
    • engine-flutter-autoroll's avatar
  2. 16 May, 2022 13 commits
  3. 15 May, 2022 7 commits
  4. 14 May, 2022 13 commits