Don't show progress center items when no items will be transferred.
Bug: 932407 Change-Id: Ieb211f62216220f9933da98186b937fff53339f7 Reviewed-on: https://chromium-review.googlesource.com/c/1487436 Commit-Queue: Sam McNally <sammc@chromium.org> Commit-Queue: Noel Gordon <noel@chromium.org> Auto-Submit: Sam McNally <sammc@chromium.org> Reviewed-by: Noel Gordon <noel@chromium.org> Cr-Commit-Position: refs/heads/master@{#635388}
This commit is contained in:
chrome/browser/chromeos/file_manager
ui/file_manager
@ -628,7 +628,8 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
|
||||
TestCase("transferFromDownloadsToTeamDrive").DisableDriveFs(),
|
||||
TestCase("transferFromDownloadsToTeamDrive").EnableDriveFs(),
|
||||
TestCase("transferBetweenTeamDrives").DisableDriveFs(),
|
||||
TestCase("transferBetweenTeamDrives").EnableDriveFs()));
|
||||
TestCase("transferBetweenTeamDrives").EnableDriveFs(),
|
||||
TestCase("transferFromDownloadsToDownloads")));
|
||||
|
||||
WRAPPED_INSTANTIATE_TEST_SUITE_P(
|
||||
RestorePrefs, /* restore_prefs.js */
|
||||
|
@ -788,16 +788,6 @@ FileTransferController.prototype.executePaste = function(pastePlan) {
|
||||
var shareEntries;
|
||||
var taskId = this.fileOperationManager_.generateTaskId();
|
||||
|
||||
// Creates early progress center item for faster user feedback.
|
||||
var item = new ProgressCenterItem();
|
||||
item.id = taskId;
|
||||
if (toMove) {
|
||||
item.message = strf('MOVE_ITEMS_REMAINING', sourceURLs.length);
|
||||
} else {
|
||||
item.message = strf('COPY_ITEMS_REMAINING', sourceURLs.length);
|
||||
}
|
||||
this.progressCenter_.updateItem(item);
|
||||
|
||||
FileTransferController.URLsToEntriesWithAccess(sourceURLs)
|
||||
.then((/**
|
||||
* @param {Object} result
|
||||
@ -818,11 +808,6 @@ FileTransferController.prototype.executePaste = function(pastePlan) {
|
||||
function(filteredEntries) {
|
||||
entries = filteredEntries;
|
||||
if (entries.length === 0) {
|
||||
// Remove the early progress center item.
|
||||
var item = new ProgressCenterItem();
|
||||
item.id = taskId;
|
||||
item.state = ProgressItemState.CANCELED;
|
||||
this.progressCenter_.updateItem(item);
|
||||
return Promise.reject('ABORT');
|
||||
}
|
||||
|
||||
|
@ -209,7 +209,8 @@ async function transferBetweenVolumes(transferInfo) {
|
||||
|
||||
// If we expected the transfer to succeed, add the pasted file to the list
|
||||
// of expected rows.
|
||||
if (!transferInfo.expectFailure) {
|
||||
if (!transferInfo.expectFailure && !transferInfo.isMove &&
|
||||
transferInfo.source !== transferInfo.destination) {
|
||||
var pasteFile = transferInfo.fileToTransfer.getExpectedRow();
|
||||
// Check if we need to add (1) to the filename, in the case of a
|
||||
// duplicate file.
|
||||
@ -228,6 +229,8 @@ async function transferBetweenVolumes(transferInfo) {
|
||||
await remoteCall.waitForFiles(
|
||||
appId, dstContentsAfterPaste,
|
||||
{ignoreFileSize: ignoreFileSize, ignoreLastModifiedTime: true});
|
||||
|
||||
return appId;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -462,3 +465,18 @@ testcase.transferBetweenTeamDrives = function() {
|
||||
'items.CopyCancel',
|
||||
}));
|
||||
};
|
||||
|
||||
/**
|
||||
* Tests that moving a file to its current location is a no-op.
|
||||
*/
|
||||
testcase.transferFromDownloadsToDownloads = async function() {
|
||||
const appId = await transferBetweenVolumes(new TransferInfo({
|
||||
fileToTransfer: ENTRIES.hello,
|
||||
source: TRANSFER_LOCATIONS.downloads,
|
||||
destination: TRANSFER_LOCATIONS.downloads,
|
||||
isMove: true,
|
||||
}));
|
||||
chrome.test.assertEq(
|
||||
'',
|
||||
(await remoteCall.waitForElement(appId, '.progress-frame label')).text);
|
||||
};
|
||||
|
Reference in New Issue
Block a user