Commit d0a02196 authored by Sasha Morrissey's avatar Sasha Morrissey Committed by Commit Bot

Clean up transfer.js browser test

Clean up transfer.js browser test, and generalize it to transfer between
different sources and destinations, move and copy and allow transfer
failures.

This is pre-work to add tests for all the possible transfer behavior
operations.

Bug: 722324
Cq-Include-Trybots: luci.chromium.try:closure_compilation
Change-Id: Ib1d43a9fe1b7160fe9c93ec10c8cfb1c460889e0
Reviewed-on: https://chromium-review.googlesource.com/1128660
Commit-Queue: Sasha Morrissey <sashab@chromium.org>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576303}
parent dca5f4d3
...@@ -119,7 +119,7 @@ test.util.sync.openFile = function(contentWindow, filename) { ...@@ -119,7 +119,7 @@ test.util.sync.openFile = function(contentWindow, filename) {
}; };
/** /**
* Selects a volume specified by its icon name * Selects a volume specified by its icon name.
* *
* @param {Window} contentWindow Window to be tested. * @param {Window} contentWindow Window to be tested.
* @param {string} iconName Name of the volume icon. * @param {string} iconName Name of the volume icon.
...@@ -255,6 +255,8 @@ test.util.sync.collapseSelectedFolderInTree = function(contentWindow) { ...@@ -255,6 +255,8 @@ test.util.sync.collapseSelectedFolderInTree = function(contentWindow) {
/** /**
* Fakes pressing the down arrow until the given |folderName| is selected in the * Fakes pressing the down arrow until the given |folderName| is selected in the
* navigation tree. * navigation tree.
* TODO(sashab): Merge this functionality into selectTeamDrive and remove this
* function.
* *
* @param {Window} contentWindow Window to be tested. * @param {Window} contentWindow Window to be tested.
* @param {string} folderName Name of the folder to be selected. * @param {string} folderName Name of the folder to be selected.
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
/** /**
* Info for the source or destination of a transfer. * Info for the source or destination of a transfer.
* @struct
*/ */
class TransferLocationInfo { class TransferLocationInfo {
/* /*
...@@ -39,10 +38,62 @@ class TransferLocationInfo { ...@@ -39,10 +38,62 @@ class TransferLocationInfo {
* @type {Array<TestEntryInfo>} * @type {Array<TestEntryInfo>}
*/ */
this.initialEntries = opts.initialEntries; this.initialEntries = opts.initialEntries;
}
}
/**
* Info for the transfer operation.
*/
class TransferInfo {
/*
* Create a new TransferInfo.
*
* @param{{
fileToTransfer: !TestEntryInfo,
source: !TransferLocationInfo,
destination: !TransferLocationInfo,
expectedDialogText: string,
isMove: boolean,
expectFailure: boolean,
}} opts Options for creating TransferInfo.
*/
constructor(opts) {
/**
* The file to copy or move. Must be in the source location.
* @type {!TestEntryInfo}
*/
this.fileToTransfer = opts.fileToTransfer;
/**
* The source location.
* @type {!TransferLocationInfo}
*/
this.source = opts.source;
/**
* The destination location.
* @type {!TransferLocationInfo}
*/
this.destination = opts.destination;
/**
* The expected content of the transfer dialog (including any buttons), or
* undefined if no dialog is expected.
* @type {string}
*/
this.expectedDialogText = opts.expectedDialogText || undefined;
/**
* True if this transfer is for a move operation, false for a copy
* operation.
* @type {!boolean}
*/
this.isMove = opts.isMove || false;
/** /**
* Whether the test is expected to fail, i.e. transferring to a folder * Whether the test is expected to fail, i.e. transferring to a folder
* without correct permissions. * without correct permissions.
* @type {!boolean}
*/ */
this.expectFailure = opts.expectFailure || false; this.expectFailure = opts.expectFailure || false;
} }
...@@ -50,55 +101,58 @@ class TransferLocationInfo { ...@@ -50,55 +101,58 @@ class TransferLocationInfo {
/** /**
* Test function to copy from the specified source to the specified destination. * Test function to copy from the specified source to the specified destination.
* @param {TestEntryInfo} targetFile TestEntryInfo of target file to be copied. * @param {TransferInfo} transferInfo Options for the transfer.
* @param {TransferLocationInfo} src The source of the transfer.
* @param {TransferLocationInfo} dst The destination of the transfer.
* @param {string|undefined} opt_dstExpectedDialogText The expected content of
* the transfer dialog (including any buttons), or undefined if no dialog is
* expected.
*/ */
function copyBetweenVolumes(targetFile, src, dst, opt_dstExpectedDialogText) { function transferBetweenVolumes(transferInfo) {
let appId; let appId;
const localFiles = BASIC_LOCAL_ENTRY_SET;
const driveFiles = (src.isTeamDrive || dst.isTeamDrive) ?
TEAM_DRIVE_ENTRY_SET :
BASIC_DRIVE_ENTRY_SET;
let srcContents; let srcContents;
if (src.isTeamDrive) { if (transferInfo.source.isTeamDrive) {
srcContents = TestEntryInfo srcContents =
.getExpectedRows(src.initialEntries.filter( TestEntryInfo
entry => entry.type !== EntryType.TEAM_DRIVE && .getExpectedRows(transferInfo.source.initialEntries.filter(
entry.teamDriveName === src.volumeName)) entry => entry.type !== EntryType.TEAM_DRIVE &&
.sort(); entry.teamDriveName === transferInfo.source.volumeName))
.sort();
} else { } else {
srcContents = TestEntryInfo srcContents =
.getExpectedRows(src.initialEntries.filter( TestEntryInfo
entry => entry.type !== EntryType.TEAM_DRIVE && .getExpectedRows(transferInfo.source.initialEntries.filter(
entry.teamDriveName === '')) entry => entry.type !== EntryType.TEAM_DRIVE &&
.sort(); entry.teamDriveName === ''))
.sort();
} }
const myDriveContent = TestEntryInfo const myDriveContent =
.getExpectedRows(src.initialEntries.filter( TestEntryInfo
entry => entry.type !== EntryType.TEAM_DRIVE && .getExpectedRows(transferInfo.source.initialEntries.filter(
entry.teamDriveName === '')) entry => entry.type !== EntryType.TEAM_DRIVE &&
.sort(); entry.teamDriveName === ''))
.sort();
let dstContents; let dstContents;
if (dst.isTeamDrive) { if (transferInfo.destination.isTeamDrive) {
dstContents = TestEntryInfo dstContents =
.getExpectedRows(dst.initialEntries.filter( TestEntryInfo
entry => entry.type !== EntryType.TEAM_DRIVE && .getExpectedRows(transferInfo.destination.initialEntries.filter(
entry.teamDriveName === dst.volumeName)) entry => entry.type !== EntryType.TEAM_DRIVE &&
.sort(); entry.teamDriveName ===
transferInfo.destination.volumeName))
.sort();
} else { } else {
dstContents = TestEntryInfo dstContents =
.getExpectedRows(dst.initialEntries.filter( TestEntryInfo
entry => entry.type !== EntryType.TEAM_DRIVE && .getExpectedRows(transferInfo.destination.initialEntries.filter(
entry.teamDriveName === '')) entry => entry.type !== EntryType.TEAM_DRIVE &&
.sort(); entry.teamDriveName === ''))
.sort();
} }
const localFiles = BASIC_LOCAL_ENTRY_SET;
const driveFiles = (transferInfo.source.isTeamDrive ||
transferInfo.destination.isTeamDrive) ?
TEAM_DRIVE_ENTRY_SET :
BASIC_DRIVE_ENTRY_SET;
StepsRunner.run([ StepsRunner.run([
// Set up File Manager. // Set up File Manager.
function() { function() {
...@@ -108,7 +162,8 @@ function copyBetweenVolumes(targetFile, src, dst, opt_dstExpectedDialogText) { ...@@ -108,7 +162,8 @@ function copyBetweenVolumes(targetFile, src, dst, opt_dstExpectedDialogText) {
// Expand Drive root if either src or dst is within Drive. // Expand Drive root if either src or dst is within Drive.
function(results) { function(results) {
appId = results.windowId; appId = results.windowId;
if (src.isTeamDrive || dst.isTeamDrive) { if (transferInfo.source.isTeamDrive ||
transferInfo.destination.isTeamDrive) {
// Select + expand + wait for its content. // Select + expand + wait for its content.
remoteCall remoteCall
.callRemoteTestUtil('selectFolderInTree', appId, ['Google Drive']) .callRemoteTestUtil('selectFolderInTree', appId, ['Google Drive'])
...@@ -130,15 +185,15 @@ function copyBetweenVolumes(targetFile, src, dst, opt_dstExpectedDialogText) { ...@@ -130,15 +185,15 @@ function copyBetweenVolumes(targetFile, src, dst, opt_dstExpectedDialogText) {
// Select the source volume. // Select the source volume.
function() { function() {
remoteCall.callRemoteTestUtil( remoteCall.callRemoteTestUtil(
src.isTeamDrive ? 'selectTeamDrive' : 'selectVolume', appId, transferInfo.source.isTeamDrive ? 'selectTeamDrive' : 'selectVolume',
[src.volumeName], this.next); appId, [transferInfo.source.volumeName], this.next);
}, },
// Wait for the expected files to appear in the file list. // Wait for the expected files to appear in the file list.
function(result) { function(result) {
chrome.test.assertTrue(result); chrome.test.assertTrue(result);
remoteCall.waitForFiles(appId, srcContents).then(this.next); remoteCall.waitForFiles(appId, srcContents).then(this.next);
}, },
// Set focus on the file list. // Focus the file list.
function() { function() {
remoteCall.callRemoteTestUtil( remoteCall.callRemoteTestUtil(
'focus', appId, ['#file-list:not([hidden])'], this.next); 'focus', appId, ['#file-list:not([hidden])'], this.next);
...@@ -146,19 +201,23 @@ function copyBetweenVolumes(targetFile, src, dst, opt_dstExpectedDialogText) { ...@@ -146,19 +201,23 @@ function copyBetweenVolumes(targetFile, src, dst, opt_dstExpectedDialogText) {
// Select the source file. // Select the source file.
function() { function() {
remoteCall.callRemoteTestUtil( remoteCall.callRemoteTestUtil(
'selectFile', appId, [targetFile.nameText], this.next); 'selectFile', appId, [transferInfo.fileToTransfer.nameText],
this.next);
}, },
// Copy the file. // Copy the file.
function(result) { function(result) {
chrome.test.assertTrue(result); chrome.test.assertTrue(result);
remoteCall.callRemoteTestUtil('execCommand', appId, ['copy'], this.next); let transferCommand = transferInfo.isMove ? 'move' : 'copy';
remoteCall.callRemoteTestUtil(
'execCommand', appId, [transferCommand], this.next);
}, },
// Select the destination volume. // Select the destination volume.
function(result) { function(result) {
chrome.test.assertTrue(result); chrome.test.assertTrue(result);
remoteCall.callRemoteTestUtil( remoteCall.callRemoteTestUtil(
dst.isTeamDrive ? 'selectTeamDrive' : 'selectVolume', appId, transferInfo.destination.isTeamDrive ? 'selectTeamDrive' :
[dst.volumeName], this.next); 'selectVolume',
appId, [transferInfo.destination.volumeName], this.next);
}, },
// Wait for the expected files to appear in the file list. // Wait for the expected files to appear in the file list.
function(result) { function(result) {
...@@ -170,9 +229,10 @@ function copyBetweenVolumes(targetFile, src, dst, opt_dstExpectedDialogText) { ...@@ -170,9 +229,10 @@ function copyBetweenVolumes(targetFile, src, dst, opt_dstExpectedDialogText) {
remoteCall.callRemoteTestUtil('execCommand', appId, ['paste'], this.next); remoteCall.callRemoteTestUtil('execCommand', appId, ['paste'], this.next);
}, },
// Wait for a dialog if one is expected, or just continue. // Wait for a dialog if one is expected, or just continue.
function() { function(result) {
chrome.test.assertTrue(result);
// If we're expecting a confirmation dialog, confirm that it is shown. // If we're expecting a confirmation dialog, confirm that it is shown.
if (opt_dstExpectedDialogText !== undefined) { if (transferInfo.expectedDialogText !== undefined) {
return remoteCall.waitForElement(appId, '.cr-dialog-container.shown') return remoteCall.waitForElement(appId, '.cr-dialog-container.shown')
.then(this.next); .then(this.next);
} else { } else {
...@@ -181,33 +241,34 @@ function copyBetweenVolumes(targetFile, src, dst, opt_dstExpectedDialogText) { ...@@ -181,33 +241,34 @@ function copyBetweenVolumes(targetFile, src, dst, opt_dstExpectedDialogText) {
}, },
// Click OK if the dialog appears. // Click OK if the dialog appears.
function(element) { function(element) {
if (opt_dstExpectedDialogText !== undefined) { if (transferInfo.expectedDialogText !== undefined) {
chrome.test.assertEq(opt_dstExpectedDialogText, element.text); chrome.test.assertEq(transferInfo.expectedDialogText, element.text);
// Press OK button. // Press OK button.
remoteCall remoteCall
.callRemoteTestUtil( .callRemoteTestUtil(
'fakeMouseClick', appId, ['button.cr-dialog-ok']) 'fakeMouseClick', appId, ['button.cr-dialog-ok'])
.then(this.next); .then(this.next);
} else { } else {
setTimeout(this.next, 0); this.next();
} }
}, },
// Wait for the file list to change, if the test is expected to pass. // Wait for the file list to change, if the test is expected to pass.
function(result) { function(result) {
if (opt_dstExpectedDialogText !== undefined) { if (transferInfo.expectedDialogText !== undefined) {
chrome.test.assertTrue(result); chrome.test.assertTrue(result);
} }
const dstContentsAfterPaste = dstContents.slice(); const dstContentsAfterPaste = dstContents.slice();
var ignoreFileSize = src.volumeName == 'drive_shared_with_me' || var ignoreFileSize =
src.volumeName == 'drive_offline' || transferInfo.source.volumeName == 'drive_shared_with_me' ||
dst.volumeName == 'drive_shared_with_me' || transferInfo.source.volumeName == 'drive_offline' ||
dst.volumeName == 'drive_offline'; transferInfo.destination.volumeName == 'drive_shared_with_me' ||
transferInfo.destination.volumeName == 'drive_offline';
// If we expected the transfer to succeed, add the pasted file to the list // If we expected the transfer to succeed, add the pasted file to the list
// of expected rows. // of expected rows.
if (!dst.expectFailure) { if (!transferInfo.expectFailure) {
var pasteFile = targetFile.getExpectedRow(); var pasteFile = transferInfo.fileToTransfer.getExpectedRow();
// Check if we need to add (1) to the filename, in the case of a // Check if we need to add (1) to the filename, in the case of a
// duplicate file. // duplicate file.
for (var i = 0; i < dstContentsAfterPaste.length; i++) { for (var i = 0; i < dstContentsAfterPaste.length; i++) {
...@@ -232,175 +293,182 @@ function copyBetweenVolumes(targetFile, src, dst, opt_dstExpectedDialogText) { ...@@ -232,175 +293,182 @@ function copyBetweenVolumes(targetFile, src, dst, opt_dstExpectedDialogText) {
]); ]);
} }
/**
* A list of transfer locations, for use with transferBetweenVolumes.
* @enum{TransferLocationInfo}
*/
const TRANSFER_LOCATIONS = Object.freeze({
drive: new TransferLocationInfo(
{volumeName: 'drive', initialEntries: BASIC_DRIVE_ENTRY_SET}),
driveWithTeamDriveEntries: new TransferLocationInfo(
{volumeName: 'drive', initialEntries: TEAM_DRIVE_ENTRY_SET}),
downloads: new TransferLocationInfo(
{volumeName: 'downloads', initialEntries: BASIC_LOCAL_ENTRY_SET}),
sharedWithMe: new TransferLocationInfo({
volumeName: 'drive_shared_with_me',
initialEntries: SHARED_WITH_ME_ENTRY_SET
}),
driveOffline: new TransferLocationInfo(
{volumeName: 'drive_offline', initialEntries: OFFLINE_ENTRY_SET}),
driveTeamDriveA: new TransferLocationInfo({
volumeName: 'Team Drive A',
isTeamDrive: true,
initialEntries: TEAM_DRIVE_ENTRY_SET
}),
driveTeamDriveB: new TransferLocationInfo({
volumeName: 'Team Drive B',
isTeamDrive: true,
initialEntries: TEAM_DRIVE_ENTRY_SET
}),
});
/** /**
* Tests copying from Drive to Downloads. * Tests copying from Drive to Downloads.
*/ */
testcase.transferFromDriveToDownloads = function() { testcase.transferFromDriveToDownloads = function() {
copyBetweenVolumes( transferBetweenVolumes(new TransferInfo({
ENTRIES.hello, fileToTransfer: ENTRIES.hello,
new TransferLocationInfo( source: TRANSFER_LOCATIONS.drive,
{volumeName: 'drive', initialEntries: BASIC_DRIVE_ENTRY_SET}), destination: TRANSFER_LOCATIONS.downloads,
new TransferLocationInfo( }));
{volumeName: 'downloads', initialEntries: BASIC_LOCAL_ENTRY_SET}));
}; };
/** /**
* Tests copying from Downloads to Drive. * Tests copying from Downloads to Drive.
*/ */
testcase.transferFromDownloadsToDrive = function() { testcase.transferFromDownloadsToDrive = function() {
copyBetweenVolumes( transferBetweenVolumes(new TransferInfo({
ENTRIES.hello, fileToTransfer: ENTRIES.hello,
new TransferLocationInfo( source: TRANSFER_LOCATIONS.downloads,
{volumeName: 'downloads', initialEntries: BASIC_LOCAL_ENTRY_SET}), destination: TRANSFER_LOCATIONS.drive,
new TransferLocationInfo( }));
{volumeName: 'drive', initialEntries: BASIC_DRIVE_ENTRY_SET}));
}; };
/** /**
* Tests copying from Drive shared with me to Downloads. * Tests copying from Drive shared with me to Downloads.
*/ */
testcase.transferFromSharedToDownloads = function() { testcase.transferFromSharedToDownloads = function() {
copyBetweenVolumes( transferBetweenVolumes(new TransferInfo({
ENTRIES.testSharedDocument, new TransferLocationInfo({ fileToTransfer: ENTRIES.testSharedDocument,
volumeName: 'drive_shared_with_me', source: TRANSFER_LOCATIONS.sharedWithMe,
initialEntries: SHARED_WITH_ME_ENTRY_SET destination: TRANSFER_LOCATIONS.downloads,
}), }));
new TransferLocationInfo(
{volumeName: 'downloads', initialEntries: BASIC_LOCAL_ENTRY_SET}));
}; };
/** /**
* Tests copying from Drive shared with me to Drive. * Tests copying from Drive shared with me to Drive.
*/ */
testcase.transferFromSharedToDrive = function() { testcase.transferFromSharedToDrive = function() {
copyBetweenVolumes( transferBetweenVolumes(new TransferInfo({
ENTRIES.testSharedDocument, new TransferLocationInfo({ fileToTransfer: ENTRIES.testSharedDocument,
volumeName: 'drive_shared_with_me', source: TRANSFER_LOCATIONS.sharedWithMe,
initialEntries: SHARED_WITH_ME_ENTRY_SET destination: TRANSFER_LOCATIONS.drive,
}), }));
new TransferLocationInfo(
{volumeName: 'drive', initialEntries: BASIC_DRIVE_ENTRY_SET}));
}; };
/** /**
* Tests copying from Drive offline to Downloads. * Tests copying from Drive offline to Downloads.
*/ */
testcase.transferFromOfflineToDownloads = function() { testcase.transferFromOfflineToDownloads = function() {
copyBetweenVolumes( transferBetweenVolumes(new TransferInfo({
ENTRIES.testDocument, fileToTransfer: ENTRIES.testDocument,
new TransferLocationInfo( source: TRANSFER_LOCATIONS.driveOffline,
{volumeName: 'drive_offline', initialEntries: OFFLINE_ENTRY_SET}), destination: TRANSFER_LOCATIONS.downloads,
new TransferLocationInfo( }));
{volumeName: 'downloads', initialEntries: BASIC_LOCAL_ENTRY_SET}));
}; };
/** /**
* Tests copying from Drive offline to Drive. * Tests copying from Drive offline to Drive.
*/ */
testcase.transferFromOfflineToDrive = function() { testcase.transferFromOfflineToDrive = function() {
copyBetweenVolumes( transferBetweenVolumes(new TransferInfo({
ENTRIES.testDocument, fileToTransfer: ENTRIES.testDocument,
new TransferLocationInfo( source: TRANSFER_LOCATIONS.driveOffline,
{volumeName: 'drive_offline', initialEntries: OFFLINE_ENTRY_SET}), destination: TRANSFER_LOCATIONS.drive,
new TransferLocationInfo( }));
{volumeName: 'drive', initialEntries: BASIC_DRIVE_ENTRY_SET}));
}; };
/** /**
* Tests copying from a Team Drive to Drive. * Tests copying from a Team Drive to Drive.
*/ */
testcase.transferFromTeamDriveToDrive = function() { testcase.transferFromTeamDriveToDrive = function() {
copyBetweenVolumes( transferBetweenVolumes(new TransferInfo({
ENTRIES.teamDriveAFile, new TransferLocationInfo({ fileToTransfer: ENTRIES.teamDriveAFile,
volumeName: 'Team Drive A', source: TRANSFER_LOCATIONS.driveTeamDriveA,
isTeamDrive: true, destination: TRANSFER_LOCATIONS.driveWithTeamDriveEntries,
initialEntries: TEAM_DRIVE_ENTRY_SET }));
}),
new TransferLocationInfo(
{volumeName: 'drive', initialEntries: TEAM_DRIVE_ENTRY_SET}));
}; };
/** /**
* Tests copying from Drive to a Team Drive. * Tests copying from Drive to a Team Drive.
*/ */
testcase.transferFromDriveToTeamDrive = function() { testcase.transferFromDriveToTeamDrive = function() {
copyBetweenVolumes( transferBetweenVolumes(new TransferInfo({
ENTRIES.hello, fileToTransfer: ENTRIES.hello,
new TransferLocationInfo( source: TRANSFER_LOCATIONS.driveWithTeamDriveEntries,
{volumeName: 'drive', initialEntries: TEAM_DRIVE_ENTRY_SET}), destination: TRANSFER_LOCATIONS.driveTeamDriveA,
new TransferLocationInfo({ expectedDialogText:
volumeName: 'Team Drive A', 'Members of \'Team Drive A\' will gain access to the copy of these ' +
isTeamDrive: true, 'items.CopyCancel',
initialEntries: TEAM_DRIVE_ENTRY_SET }));
}),
'Members of \'Team Drive A\' will gain access to the copy of these ' +
'items.CopyCancel');
}; };
/** /**
* Tests copying from a Team Drive to Downloads. * Tests copying from a Team Drive to Downloads.
*/ */
testcase.transferFromTeamDriveToDownloads = function() { testcase.transferFromTeamDriveToDownloads = function() {
copyBetweenVolumes( transferBetweenVolumes(new TransferInfo({
ENTRIES.teamDriveAFile, new TransferLocationInfo({ fileToTransfer: ENTRIES.teamDriveAFile,
volumeName: 'Team Drive A', source: TRANSFER_LOCATIONS.driveTeamDriveA,
isTeamDrive: true, destination: TRANSFER_LOCATIONS.downloads,
initialEntries: TEAM_DRIVE_ENTRY_SET }));
}),
new TransferLocationInfo(
{volumeName: 'downloads', initialEntries: BASIC_LOCAL_ENTRY_SET}));
}; };
/** /**
* Tests that a gdoc file cannot be transferred from a Team Drive to a local * Tests that a hosted file cannot be transferred from a Team Drive to a local
* drive (e.g. Downloads). * drive (e.g. Downloads). Hosted documents only make sense in the context of
* Drive.
*/ */
testcase.transferHostedFileFromTeamDriveToDownloads = function() { testcase.transferHostedFileFromTeamDriveToDownloads = function() {
copyBetweenVolumes( transferBetweenVolumes(new TransferInfo({
ENTRIES.teamDriveAHostedFile, new TransferLocationInfo({ fileToTransfer: ENTRIES.teamDriveAHostedFile,
volumeName: 'Team Drive A', source: TRANSFER_LOCATIONS.driveTeamDriveA,
isTeamDrive: true, destination: TRANSFER_LOCATIONS.driveWithTeamDriveEntries,
initialEntries: TEAM_DRIVE_ENTRY_SET expectFailure: true,
}), }));
new TransferLocationInfo({
volumeName: 'downloads',
initialEntries: BASIC_LOCAL_ENTRY_SET,
expectFailure: true
}));
}; };
/** /**
* Tests copying from Downloads to a Team Drive. * Tests copying from Downloads to a Team Drive.
*/ */
testcase.transferFromDownloadsToTeamDrive = function() { testcase.transferFromDownloadsToTeamDrive = function() {
copyBetweenVolumes( transferBetweenVolumes(new TransferInfo({
ENTRIES.hello, fileToTransfer: ENTRIES.hello,
new TransferLocationInfo( source: TRANSFER_LOCATIONS.downloads,
{volumeName: 'downloads', initialEntries: BASIC_LOCAL_ENTRY_SET}), destination: TRANSFER_LOCATIONS.driveTeamDriveA,
new TransferLocationInfo({ expectedDialogText:
volumeName: 'Team Drive A', 'Members of \'Team Drive A\' will gain access to the copy of these ' +
isTeamDrive: true, 'items.CopyCancel',
initialEntries: TEAM_DRIVE_ENTRY_SET }));
}),
'Members of \'Team Drive A\' will gain access to the copy of these ' +
'items.CopyCancel');
}; };
/** /**
* Tests copying between two Team Drives. * Tests copying between Team Drives.
*/ */
testcase.transferBetweenTeamDrives = function() { testcase.transferBetweenTeamDrives = function() {
copyBetweenVolumes( transferBetweenVolumes(new TransferInfo({
ENTRIES.teamDriveBFile, new TransferLocationInfo({ fileToTransfer: ENTRIES.teamDriveBFile,
volumeName: 'Team Drive B', source: TRANSFER_LOCATIONS.driveTeamDriveB,
isTeamDrive: true, destination: TRANSFER_LOCATIONS.driveTeamDriveA,
initialEntries: TEAM_DRIVE_ENTRY_SET expectedDialogText:
}), 'Members of \'Team Drive A\' will gain access to the copy of these ' +
new TransferLocationInfo({ 'items.CopyCancel',
volumeName: 'Team Drive A', }));
isTeamDrive: true,
initialEntries: TEAM_DRIVE_ENTRY_SET
}),
'Members of \'Team Drive A\' will gain access to the copy of these ' +
'items.CopyCancel');
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment