Files app: Select My files when there are no volumes

Make Files app select "My files" when there are no available volumes,
this to allow Files app to behave properly when volumes subsequently
become available.

Change DirectoryModel.onVolumeInfoListUpdated_ method to check for
non-null |displayRoot| before trying to change to |displayRoot|. This
fixes the error "Cannot read property 'getParent' of null" when Drive
volume becomes available before the (default) Downloads volume/root.

Change FakeDriveFs to unbind the two mojo bindings if they're bound, so
DriveFsTestVolume can re-mount itself.

Changes since revert:
1. Add a new function |getVolumesCount| to return the number of volumes
available in the background page.
2. Add the new function above to wait for background page to have all
volumes before un-mounting and wait it to unmount all volumes.
3. Change some logs from error to warn because errors are expected and
handled when initializing volumes that are unmounting/unmounted in the
4. Change selector used to click on Drive to actually wait for
"My Drive" to be available.
5. A bit of more info in some logs around volume initialization.

Test: browser_tests --gtest_filter="*/fileDisplayWithoutVolumesThenMount*"
Bug: 893161, 884967, 894799
Change-Id: I7dcb340991750e9e79a9963990b614c6d7275890
Reviewed-by: Noel Gordon <>
Reviewed-by: Sam McNally <>
Commit-Queue: Luciano Pacheco <>
Cr-Commit-Position: refs/heads/master@{#600282}
9 files changed