* Update asset_bundle_package_test to use MemoryFileSystem
This updates all tests in this file to use a memory filesystem (same as I did for asset_bundle_package_font_test) based on the current platform.
There were already a few minor tests at the bottom using a MemoryFileSystem and being run for all platforms - however this complicated the shared code I changed above to support Windows natively so I changed them to also work the same as others (that is, they just run the native platforms so require running on all to get full coverage - though this is the case for almost all other tests anyway).
* Move fixPath to the correct place
* Change assert_bundle_package_font_test to memory file system
This is to work towards being able to run the tests without `-j1` (#21113). These tests were using the real filesystem and setting/relying on fs.currentDirectory. There was a comment about this being because the memory provider didnt' support POSIX and Windows, however that seems to have changed since (and many other asset tests already do something similar to this).
* Trim trailing whitespace
* Add a workaround for Windows path slash directions
Strictly this is correct, but the real FS can tolerate either path. The in-memory file system is more strict (see https://github.com/google/file.dart/issues/112).
* Extract a helper for writing schema files in tests
* Missed file when saving!
* Remove redundant comment
* Rename writeBasicSchema -> writeEmptySchema
* Use the file we already have to write contents
* Make comments more descriptive
* Remove another dupe of writeSchema to use the shared one
* Rename schema -> pubspec_schema
* Trim whitespace
All temporary directory start with `flutter_` and have their random component separated from the name by a period, as in `flutter_test_bundle.YFYQMY`.
I've tried to find some of the places where we didn't cleanly delete temporary directories, too. This greatly reduces, though it does not entirely eliminate, the directories we leave behind when running tests, especially `flutter_tools` tests.
While I was at it I standardized on `tempDir` as the variable name for temporary directories, since it was the most common, removing occurrences of `temp` and `tmp`, among others.
Also I factored out some common code that used to catch exceptions that happen on Windows, and made more places use that pattern.
* Upgrade everything except matcher.
* Roll matcher (and test)
* Adjust tests that depend on flutter:test directly to depend on a shim
* Require use of package:test shim and remove other references to package:test
* Make the current command injected into the AppContext, allowing
other classes to inject the current command.
* Introduce `AssetBundleFactory`, an injected factory class for
spawning instances of `AssetBundle`. This allows other run contexts
to use custom asset bundling logic.
* Clean up RunCommand by removing a 'packages' argument that duplicated
a global argument by the same name (and for the same purpose).
Duplicate arguments are confusing and error-prone.