Commit b68bc5ef authored by Sam McNally's avatar Sam McNally Committed by Commit Bot

Allow sharing of team drives when DriveFS is enabled.

Bug: 867154
Change-Id: I456d03ab6ec8f9f995d8cbbc00f2a3e6b195bef1
Reviewed-on: https://chromium-review.googlesource.com/c/1352117Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611495}
parent 0d185747
...@@ -580,6 +580,7 @@ WRAPPED_INSTANTIATE_TEST_CASE_P( ...@@ -580,6 +580,7 @@ WRAPPED_INSTANTIATE_TEST_CASE_P(
TestCase("shareFileTeamDrive"), TestCase("shareFileTeamDrive"),
TestCase("shareDirectoryTeamDrive"), TestCase("shareDirectoryTeamDrive"),
TestCase("shareHostedFileTeamDrive"), TestCase("shareHostedFileTeamDrive"),
TestCase("shareTeamDrive"),
TestCase("manageHostedFileTeamDrive"), TestCase("manageHostedFileTeamDrive"),
TestCase("manageFileTeamDrive"), TestCase("manageFileTeamDrive"),
TestCase("manageDirectoryTeamDrive"), TestCase("manageDirectoryTeamDrive"),
......
...@@ -120,7 +120,9 @@ DriveShareAction.prototype.canExecute = function() { ...@@ -120,7 +120,9 @@ DriveShareAction.prototype.canExecute = function() {
const canShareItem = metadata[0].canShare !== false; const canShareItem = metadata[0].canShare !== false;
return this.volumeManager_.getDriveConnectionState().type !== return this.volumeManager_.getDriveConnectionState().type !==
VolumeManagerCommon.DriveConnectionType.OFFLINE && VolumeManagerCommon.DriveConnectionType.OFFLINE &&
!util.isTeamDriveRoot(this.entry_) && canShareItem; (loadTimeData.getBoolean('DRIVE_FS_ENABLED') ||
!util.isTeamDriveRoot(this.entry_)) &&
canShareItem;
}; };
/** /**
......
...@@ -24,18 +24,20 @@ function shareWithOthersExpectBrowserURL(path, url, teamDrive = undefined) { ...@@ -24,18 +24,20 @@ function shareWithOthersExpectBrowserURL(path, url, teamDrive = undefined) {
// Navigate to the specified team drive if one is specified. // Navigate to the specified team drive if one is specified.
function(results) { function(results) {
appId = results.windowId; appId = results.windowId;
if (!teamDrive) { if (teamDrive === undefined) {
this.next(); this.next();
return; return;
} }
remoteCall remoteCall
.navigateWithDirectoryTree( .navigateWithDirectoryTree(
appId, `/team_drives/${teamDrive}`, 'Team Drives', 'drive') appId,
teamDrive === '' ? '/team_drives' : `/team_drives/${teamDrive}`,
'Team Drives', 'drive')
.then(this.next); .then(this.next);
}, },
// Wait for the file list to update if we navigated. // Wait for the file list to update if we navigated.
function() { function() {
if (!teamDrive) { if (teamDrive === undefined) {
this.next(); this.next();
return; return;
} }
...@@ -359,3 +361,12 @@ testcase.manageTeamDrive = function() { ...@@ -359,3 +361,12 @@ testcase.manageTeamDrive = function() {
const URL = 'https://folder_alternate_link/Team%20Drive%20A'; const URL = 'https://folder_alternate_link/Team%20Drive%20A';
manageWithDriveExpectBrowserURL('Team Drive A', URL, ''); manageWithDriveExpectBrowserURL('Team Drive A', URL, '');
}; };
/**
* Tests sharing a team drive.
*/
testcase.shareTeamDrive = function() {
const URL =
'https://folder_alternate_link/Team%20Drive%20A?userstoinvite=%22%22';
shareWithOthersExpectBrowserURL('Team Drive A', URL, '');
};
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