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

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

Issue 2538413002: Postpone automatic popup of cloud backup details until ready to backup. (Closed)
Patch Set: Update import controller unittest to reflect UI flow change. Created 4 years 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
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/import_controller.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a21545d3160a166c4fc8327a908ccf0a59b2e906..738545fb3fc86207819b7d94dc5edb4d70673a19 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
@@ -201,7 +201,7 @@ function testWindowClose_CancelsScan(callback) {
reportPromise(promise, callback);
}
-function testDirectoryChange_DetailsPanelVisibility_InitialChangeDir() {
+function testDirectoryChange_DetailsPanelVisibility_InitialChangeDir(callback) {
var controller = createController(
VolumeManagerCommon.VolumeType.MTP,
'mtp-volume',
@@ -212,13 +212,32 @@ function testDirectoryChange_DetailsPanelVisibility_InitialChangeDir() {
],
'/DCIM');
+ var fileSystem = new MockFileSystem('testFs');
var event = new Event('directory-changed');
event.newDirEntry = new MockDirectoryEntry(
- new MockFileSystem('testFs'),
+ fileSystem,
'/DCIM/');
+ // ensure there is some content in the scan so the code that depends
+ // on this state doesn't croak which it finds it missing.
+ mediaScanner.fileEntries.push(
+ new MockFileEntry(fileSystem, '/DCIM/photos0/IMG00001.jpg', {size: 0}));
+ // Make controller enter a scanning state.
environment.directoryChangedListener(event);
- assertTrue(widget.detailsVisible);
+ assertFalse(widget.detailsVisible);
+
+ var promise = widget.updateResolver.promise.then(function() {
+ // "scanning..."
+ assertFalse(widget.detailsVisible);
+ widget.resetPromises();
+ mediaScanner.finalizeScans();
+ return widget.updateResolver.promise;
+ }).then(function() {
+ // "ready to update"
+ // Details should pop up.
+ assertTrue(widget.detailsVisible);
+ });
+ reportPromise(promise, callback);
}
function testDirectoryChange_DetailsPanelVisibility_SubsequentChangeDir() {
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/import_controller.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698