google / flutter-desktop-embedding

Experimental plugins for Flutter for Desktop
Apache License 2.0
7.1k stars 604 forks source link

[file_selector] Add Linux unit tests #904

Closed stuartmorgan closed 2 years ago

stuartmorgan commented 2 years ago

Part one of preparation to move this implementation to flutter/plugins. Unlike the previous moves, I'm adding tests before moving, as it makes reviewing the deltas easier; the final move can make only the minor changes needed for the move itself instead of having functional diffs as well.

Since the tests run in the context of the example app, and since there are no longer multiple implementations in this repo to share an example between, this moves the example app into the package.

The testing here isn't as complete as I would like; it's testing internals that cover a significant portion but definitely not all of the native logic. This is a balance between getting some meaningful testing in place (and thus allowing moving and endorsing it) against the amount of time it would take me to fully test (ramping up on doing mocking, callback wrapper patterns, etc. in GObject).

(Part two will add a Dart implementation to move the method channel in-package.)