Index: ui/file_manager/file_manager/foreground/js/import_controller_unittest.js |
diff --git a/ui/file_manager/file_manager/foreground/js/import_controller_unittest.js b/ui/file_manager/file_manager/foreground/js/import_controller_unittest.js |
index 9e9fef5541e7498b53df9b940c38049d5d27d8f4..d58e5deb553bef311dafa8abbc7756476b88f642 100644 |
--- a/ui/file_manager/file_manager/foreground/js/import_controller_unittest.js |
+++ b/ui/file_manager/file_manager/foreground/js/import_controller_unittest.js |
@@ -116,6 +116,25 @@ function testGetCommandUpdate_InitiatesScan() { |
mediaScanner.assertScanCount(1); |
} |
+function testDirectoryChange_InitiatesUpdate() { |
+ var controller = createController( |
+ VolumeManagerCommon.VolumeType.MTP, |
+ 'mtp-volume', |
+ [ |
+ '/DCIM/', |
+ '/DCIM/photos0/', |
+ '/DCIM/photos0/IMG00001.jpg', |
+ '/DCIM/photos0/IMG00002.jpg', |
+ '/DCIM/photos1/', |
+ '/DCIM/photos1/IMG00001.jpg', |
+ '/DCIM/photos1/IMG00003.jpg' |
+ ], |
+ '/DCIM'); |
+ |
+ environment.directoryChangedListener_(); |
+ commandUpdateRecorder.assertCallCount(1); |
+} |
+ |
function testUnmountInvalidatesScans() { |
var controller = createController( |
VolumeManagerCommon.VolumeType.MTP, |
@@ -338,6 +357,9 @@ TestControllerEnvironment = function(volumeInfo, directory) { |
/** @private {function(string)} */ |
this.volumeUnmountListener_; |
+ /** @private {function()} */ |
+ this.directoryChangedListener_; |
+ |
/** @public {!DirectoryEntry} */ |
this.selection = []; |
@@ -389,6 +411,12 @@ TestControllerEnvironment.prototype.addVolumeUnmountListener = |
this.volumeUnmountListener_ = listener; |
}; |
+/** @override */ |
+TestControllerEnvironment.prototype.addDirectoryChangedListener = |
+ function(listener) { |
+ this.directoryChangedListener_ = listener; |
+}; |
+ |
/** |
* Simulates an unmount event. |
*/ |