dart-lang/chromedeveditor — pull request #3063 by umop (2014-08-04 23:19:22+00:00)
Title: Testing filesystem actions with mock filesystems

This adds UI tests which require filesystem access. A new class, `FileSystemAccess` is created in `filesystem.dart` which gives access to filesystem operations. The class is non-instantiatable outside of the package and has a top-level accessor `fileSystemAccess`. `ProjectLocationManager`, `LocationResult`, and `_selectFolder()` were moved from `spark.dart` into `filesystem.dart`.

Mock classes `MockFilesystemAccess` and `MockProjectLocationManager` were added to the same file (would have preferred to keep them in the `test/` directory, but I would have had to have made `FileSystemAcccess` publicly instantiate-able to do that.

The mock filesystem classes allow for a root to be simulated so that project setups can be faked for testing using the `files_mock.dart` classes.

I rearranged how filesystem access is setup so that automated testing can test operations requiring storage access. The filesystem decisions (whether actual or mock) remains clear until a root folder has been selected (either by user selecting the root, a preference being restored, or the `setupRoot()` method of `MockProjectLocationManager` being called).

In addition to the filesystem access work, added input entry and key entry handlers (key entry doesn't work currently) `sendString`. It uses `textInput` at the moment, but will hopefully eventually send individual keys via `sendKey`.