Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(608)

Unified Diff: ui/file_manager/file_manager/foreground/js/import_controller_unittest.js

Issue 883973002: Move cloud import button to toolbar, make material designey. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test coverage for new command update logic. Fix a type, and undo some early debug code. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.
*/
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/import_controller.js ('k') | ui/file_manager/file_manager/main.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698