Commit d8110958 authored by Maxim Kolosovskiy's avatar Maxim Kolosovskiy Committed by Commit Bot

Revert "Add tests for sharing and managing items in team drives."

This reverts commit 8fcafe0e.

Reason for revert: the CL caused test failure https://bugs.chromium.org/p/chromium/issues/detail?id=906577

Original change's description:
> Add tests for sharing and managing items in team drives.
> 
> Bug: 903637
> Change-Id: Ic9f49f7de59210e400a578060eb611fafebe193f
> Reviewed-on: https://chromium-review.googlesource.com/c/1341287
> Commit-Queue: Sam McNally <sammc@chromium.org>
> Reviewed-by: Noel Gordon <noel@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#609191}

TBR=noel@chromium.org,sammc@chromium.org

Change-Id: I6385ca389f4f2e8807ee6a34c4a0a27744c5ac39
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 903637
Reviewed-on: https://chromium-review.googlesource.com/c/1341516Reviewed-by: default avatarMaxim Kolosovskiy <kolos@chromium.org>
Commit-Queue: Maxim Kolosovskiy <kolos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609232}
parent 165c8900
......@@ -544,19 +544,12 @@ WRAPPED_INSTANTIATE_TEST_CASE_P(
TestCase("shareFileDrive").EnableDriveFs(),
TestCase("shareDirectoryDrive").DisableDriveFs(),
TestCase("shareDirectoryDrive").EnableDriveFs(),
TestCase("shareHostedFileDrive"),
TestCase("manageHostedFileDrive").DisableDriveFs(),
TestCase("manageHostedFileDrive").EnableDriveFs(),
TestCase("manageFileDrive").DisableDriveFs(),
TestCase("manageFileDrive").EnableDriveFs(),
TestCase("manageDirectoryDrive").DisableDriveFs(),
TestCase("manageDirectoryDrive").EnableDriveFs(),
TestCase("shareFileTeamDrive"),
TestCase("shareDirectoryTeamDrive"),
TestCase("shareHostedFileTeamDrive"),
TestCase("manageHostedFileTeamDrive"),
TestCase("manageFileTeamDrive"),
TestCase("manageDirectoryTeamDrive")));
TestCase("manageDirectoryDrive").EnableDriveFs()));
WRAPPED_INSTANTIATE_TEST_CASE_P(
SuggestAppDialog, /* suggest_app_dialog.js */
......
......@@ -91,7 +91,6 @@ test.util.sync.getFileList = function(contentWindow) {
*/
test.util.sync.selectFile = function(contentWindow, filename) {
var rows = contentWindow.document.querySelectorAll('#detail-table li');
test.util.sync.focus(contentWindow, '#file-list');
test.util.sync.fakeKeyDown(
contentWindow, '#file-list', 'Home', false, false, false);
for (var index = 0; index < rows.length; ++index) {
......
......@@ -246,7 +246,6 @@ var TEAM_DRIVE_ENTRY_SET = [
ENTRIES.hello,
ENTRIES.teamDriveA,
ENTRIES.teamDriveAFile,
ENTRIES.teamDriveADirectory,
ENTRIES.teamDriveAHostedFile,
ENTRIES.teamDriveB,
ENTRIES.teamDriveBFile,
......
......@@ -9,32 +9,19 @@
*
* @param {!string} path Path of the file or directory to be shared.
* @param {!string} url Expected URL for the browser to visit.
* @param {!string|undefined} teamDrive If set, the team drive to switch to.
*/
function shareWithOthersExpectBrowserURL(path, url, teamDrive = undefined) {
function shareWithOthersExpectBrowserURL(path, url) {
let appId;
StepsRunner.run([
// Open Files app on Drive.
function() {
setupAndWaitUntilReady(
null, RootPath.DRIVE, this.next, [],
BASIC_DRIVE_ENTRY_SET.concat(TEAM_DRIVE_ENTRY_SET));
null, RootPath.DRIVE, this.next, [], BASIC_DRIVE_ENTRY_SET);
},
// Navigate to the specified team drive if one is specified.
// Select the given |path|.
function(results) {
appId = results.windowId;
if (!teamDrive) {
this.next();
return;
}
remoteCall
.navigateWithDirectoryTree(
appId, `/team_drives/${teamDrive}`, 'Team Drives', 'drive')
.then(this.next);
},
// Select the given |path|.
function() {
remoteCall.callRemoteTestUtil('selectFile', appId, [path], this.next);
},
// Wait for the entry to be selected.
......@@ -93,32 +80,19 @@ function shareWithOthersExpectBrowserURL(path, url, teamDrive = undefined) {
*
* @param {!string} path Path of the file or directory to be managed.
* @param {!string} url Expected URL for the browser to visit.
* @param {!string|undefined} teamDrive If set, the team drive to switch to.
*/
function manageWithDriveExpectBrowserURL(path, url, teamDrive = undefined) {
function manageWithDriveExpectBrowserURL(path, url) {
let appId;
StepsRunner.run([
// Open Files app on Drive.
function() {
setupAndWaitUntilReady(
null, RootPath.DRIVE, this.next, [],
BASIC_DRIVE_ENTRY_SET.concat(TEAM_DRIVE_ENTRY_SET));
null, RootPath.DRIVE, this.next, [], BASIC_DRIVE_ENTRY_SET);
},
// Navigate to the specified team drive if one is specified.
// Select the given |path|.
function(results) {
appId = results.windowId;
if (!teamDrive) {
this.next();
return;
}
remoteCall
.navigateWithDirectoryTree(
appId, `/team_drives/${teamDrive}`, 'Team Drives', 'drive')
.then(this.next);
},
// Select the given |path|.
function() {
remoteCall.callRemoteTestUtil('selectFile', appId, [path], this.next);
},
// Wait for the entry to be selected.
......@@ -193,15 +167,6 @@ testcase.shareDirectoryDrive = function() {
shareWithOthersExpectBrowserURL('photos', URL);
};
/**
* Tests sharing a hosted file (gdoc) on Drive.
*/
testcase.shareHostedFileDrive = function() {
const URL =
'https://document_alternate_link/Test%20Document?userstoinvite=%22%22';
shareWithOthersExpectBrowserURL('Test Document.gdoc', URL);
};
/**
* Tests managing a file on Drive.
*/
......@@ -226,103 +191,4 @@ testcase.manageHostedFileDrive = function() {
manageWithDriveExpectBrowserURL('Test Document.gdoc', URL);
};
/**
* Tests sharing a file in a team drive.
*/
testcase.shareFileTeamDrive = function() {
const URL =
'https://file_alternate_link/teamDriveAFile.txt?userstoinvite=%22%22';
shareWithOthersExpectBrowserURL('teamDriveAFile.txt', URL, 'Team Drive A');
};
/**
* Tests that sharing a directory in a team drive is not allowed.
*/
testcase.shareDirectoryTeamDrive = function() {
let appId;
const teamDrive = 'Team Drive A';
const path = 'teamDriveADirectory';
StepsRunner.run([
// Open Files app on Drive.
function() {
setupAndWaitUntilReady(
null, RootPath.DRIVE, this.next, [],
BASIC_DRIVE_ENTRY_SET.concat(TEAM_DRIVE_ENTRY_SET));
},
// Navigate to the team drive.
function(results) {
appId = results.windowId;
remoteCall
.navigateWithDirectoryTree(
appId, `/team_drives/${teamDrive}`, 'Team Drives', 'drive')
.then(this.next);
},
// Select the given |path|.
function() {
remoteCall.callRemoteTestUtil('selectFile', appId, [path], this.next);
},
// Wait for the entry to be selected.
function(result) {
chrome.test.assertTrue(!!result, 'selectFile failed');
remoteCall.waitForElement(appId, '.table-row[selected]').then(this.next);
},
// Right-click the selected entry.
function(result) {
chrome.test.assertTrue(!!result);
remoteCall.callRemoteTestUtil(
'fakeMouseRightClick', appId, ['.table-row[selected]'], this.next);
},
// Wait for the context menu to appear.
function(result) {
chrome.test.assertTrue(!!result, 'fakeMouseClick failed');
remoteCall.waitForElement(appId, '#file-context-menu:not([hidden])')
.then(this.next);
},
// Wait for the "Share" menu item to appear.
function(result) {
chrome.test.assertTrue(!!result);
remoteCall
.waitForElement(appId, '[command="#share"]:not([hidden])[disabled]')
.then(this.next);
},
function() {
checkIfNoErrorsOccured(this.next);
}
]);
};
/**
* Tests sharing a hosted file (gdoc) in a team drive.
*/
testcase.shareHostedFileTeamDrive = function() {
const URL =
'https://document_alternate_link/teamDriveAHostedDoc?userstoinvite=%22%22';
shareWithOthersExpectBrowserURL(
'teamDriveAHostedDoc.gdoc', URL, 'Team Drive A');
};
/**
* Tests managing a file in a team drive.
*/
testcase.manageFileTeamDrive = function() {
const URL = 'https://file_alternate_link/teamDriveAFile.txt';
manageWithDriveExpectBrowserURL('teamDriveAFile.txt', URL, 'Team Drive A');
};
/**
* Tests managing a directory in a team drive.
*/
testcase.manageDirectoryTeamDrive = function() {
const URL = 'https://folder_alternate_link/teamDriveADirectory';
manageWithDriveExpectBrowserURL('teamDriveADirectory', URL, 'Team Drive A');
};
/**
* Tests managing a hosted file (gdoc) in a team drive.
*/
testcase.manageHostedFileTeamDrive = function() {
const URL = 'https://document_alternate_link/teamDriveAHostedDoc';
manageWithDriveExpectBrowserURL(
'teamDriveAHostedDoc.gdoc', URL, 'Team Drive A');
};
// TODO(903637): Add tests for sharing a file on Team Drives.
......@@ -758,23 +758,6 @@ var ENTRIES = {
},
}),
teamDriveADirectory: new TestEntryInfo({
type: EntryType.DIRECTORY,
targetPath: 'teamDriveADirectory',
lastModifiedTime: 'Jan 1, 2000, 1:00 AM',
nameText: 'teamDriveADirectory',
sizeText: '--',
typeText: 'Folder',
teamDriveName: 'Team Drive A',
capabilities: {
canCopy: true,
canDelete: true,
canRename: true,
canAddChildren: true,
canShare: false,
},
}),
teamDriveAHostedFile: new TestEntryInfo({
type: EntryType.FILE,
targetPath: 'teamDriveAHostedDoc',
......
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