Commit 6fb21602 authored by Roger Tawa's avatar Roger Tawa Committed by Commit Bot

Revert "Add integration test for Install with Linux context menu option"

This reverts commit dd7de273.

Reason for revert: See crbug.com/993369 for details.
ContextMenu2/FilesAppBrowserTest.Test/checkInstallWithLinuxStateForDebianFile_DriveFs fails consistently.

Original change's description:
> Add integration test for Install with Linux context menu option
> 
> Add test to ensure the "Install with Linux" context menu option is
> hidden/shown when Crostini root access is allowed or disallowed by
> kUserCrostiniRootAccessAllowedByPolicy policy preference control.
> 
> Feature flag kCrostiniAdvancedAccessControls is enabled for file
> manager browser tests to test this functionality which is hidden
> behind the flag.
> 
> Follow up CL to crosreview.com/1730907
> 
> Bug: 983997
> Change-Id: I12f70ea516528275b327525119587d0f0742a50d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1738686
> Commit-Queue: Christopher Gunadi <chrisgunadi@google.com>
> Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
> Reviewed-by: Noel Gordon <noel@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#686349}

TBR=noel@chromium.org,lucmult@chromium.org,chrisgunadi@google.com

Change-Id: I588c0d21861b603f972977cb34aff66a1e88dd24
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 983997
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1752124Reviewed-by: default avatarRoger Tawa <rogerta@chromium.org>
Commit-Queue: Roger Tawa <rogerta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686416}
parent d305bf6e
...@@ -472,7 +472,6 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -472,7 +472,6 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
.DisableDriveFs(), .DisableDriveFs(),
TestCase("checkPasteIntoFolderDisabledForReadOnlyFolder") TestCase("checkPasteIntoFolderDisabledForReadOnlyFolder")
.DisableDriveFs(), .DisableDriveFs(),
TestCase("checkInstallWithLinuxStateForDebianFile").DisableDriveFs(),
TestCase("checkContextMenusForInputElements"), TestCase("checkContextMenusForInputElements"),
TestCase("checkNewFolderEnabledInsideReadWriteFolder").DisableDriveFs(), TestCase("checkNewFolderEnabledInsideReadWriteFolder").DisableDriveFs(),
TestCase("checkNewFolderDisabledInsideReadOnlyFolder").DisableDriveFs(), TestCase("checkNewFolderDisabledInsideReadOnlyFolder").DisableDriveFs(),
...@@ -509,7 +508,6 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -509,7 +508,6 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
.EnableDriveFs(), .EnableDriveFs(),
TestCase("checkPasteIntoFolderDisabledForReadOnlyFolder") TestCase("checkPasteIntoFolderDisabledForReadOnlyFolder")
.EnableDriveFs(), .EnableDriveFs(),
TestCase("checkInstallWithLinuxStateForDebianFile").EnableDriveFs(),
TestCase("checkNewFolderEnabledInsideReadWriteFolder").EnableDriveFs(), TestCase("checkNewFolderEnabledInsideReadWriteFolder").EnableDriveFs(),
TestCase("checkNewFolderDisabledInsideReadOnlyFolder").EnableDriveFs(), TestCase("checkNewFolderDisabledInsideReadOnlyFolder").EnableDriveFs(),
TestCase("checkPasteEnabledInsideReadWriteFolder").EnableDriveFs(), TestCase("checkPasteEnabledInsideReadWriteFolder").EnableDriveFs(),
......
...@@ -1529,8 +1529,6 @@ void FileManagerBrowserTestBase::SetUpCommandLine( ...@@ -1529,8 +1529,6 @@ void FileManagerBrowserTestBase::SetUpCommandLine(
std::vector<base::Feature> enabled_features; std::vector<base::Feature> enabled_features;
std::vector<base::Feature> disabled_features; std::vector<base::Feature> disabled_features;
enabled_features.emplace_back(features::kCrostiniAdvancedAccessControls);
if (!IsGuestModeTest()) { if (!IsGuestModeTest()) {
enabled_features.emplace_back(features::kCrostini); enabled_features.emplace_back(features::kCrostini);
} }
...@@ -1634,8 +1632,6 @@ void FileManagerBrowserTestBase::SetUpOnMainThread() { ...@@ -1634,8 +1632,6 @@ void FileManagerBrowserTestBase::SetUpOnMainThread() {
// for testing without such tight coupling. // for testing without such tight coupling.
crostini_volume_ = std::make_unique<CrostiniTestVolume>(); crostini_volume_ = std::make_unique<CrostiniTestVolume>();
profile()->GetPrefs()->SetBoolean(crostini::prefs::kCrostiniEnabled, true); profile()->GetPrefs()->SetBoolean(crostini::prefs::kCrostiniEnabled, true);
profile()->GetPrefs()->SetBoolean(
crostini::prefs::kUserCrostiniRootAccessAllowedByPolicy, true);
crostini::CrostiniManager* crostini_manager = crostini::CrostiniManager* crostini_manager =
crostini::CrostiniManager::GetForProfile( crostini::CrostiniManager::GetForProfile(
profile()->GetOriginalProfile()); profile()->GetOriginalProfile());
...@@ -2128,14 +2124,6 @@ void FileManagerBrowserTestBase::OnCommand(const std::string& name, ...@@ -2128,14 +2124,6 @@ void FileManagerBrowserTestBase::OnCommand(const std::string& name,
return; return;
} }
if (name == "setCrostiniRootAccessAllowed") {
bool enabled;
ASSERT_TRUE(value.GetBoolean("enabled", &enabled));
profile()->GetPrefs()->SetBoolean(
crostini::prefs::kUserCrostiniRootAccessAllowedByPolicy, enabled);
return;
}
if (name == "useCellularNetwork") { if (name == "useCellularNetwork") {
net::NetworkChangeNotifier::NotifyObserversOfMaxBandwidthChangeForTests( net::NetworkChangeNotifier::NotifyObserversOfMaxBandwidthChangeForTests(
net::NetworkChangeNotifier::GetMaxBandwidthMbpsForConnectionSubtype( net::NetworkChangeNotifier::GetMaxBandwidthMbpsForConnectionSubtype(
......
...@@ -30,35 +30,6 @@ async function maybeCopyToClipboard(appId, commandId, file = 'hello.txt') { ...@@ -30,35 +30,6 @@ async function maybeCopyToClipboard(appId, commandId, file = 'hello.txt') {
'execCommand failed'); 'execCommand failed');
} }
/**
* Selects a file.
*
* @param {string} appId ID of the app window.
* @param {string} path Path to the file to be selected.
*/
async function selectFile(appId, path) {
// Select the file |path|.
chrome.test.assertTrue(
!!await remoteCall.callRemoteTestUtil('selectFile', appId, [path]));
// Wait for the file to be selected.
await remoteCall.waitForElement(appId, '.table-row[selected]');
}
/**
* Right clicks the currently selected file to show context menu.
*
* @param {string} appId ID of the app window.
*/
async function rightClickSelectedFile(appId) {
// Right-click the selected file.
chrome.test.assertTrue(!!await remoteCall.callRemoteTestUtil(
'fakeMouseRightClick', appId, ['.table-row[selected]']));
// Wait for the context menu to appear.
await remoteCall.waitForElement(appId, '#file-context-menu:not([hidden])');
}
/** /**
* Tests that the specified menu item is in |expectedEnabledState| when the * Tests that the specified menu item is in |expectedEnabledState| when the
* entry at |path| is selected. * entry at |path| is selected.
...@@ -282,53 +253,6 @@ testcase.checkPasteIntoFolderDisabledForReadOnlyFolder = () => { ...@@ -282,53 +253,6 @@ testcase.checkPasteIntoFolderDisabledForReadOnlyFolder = () => {
return checkContextMenu('paste-into-folder', 'Read-Only Folder', false); return checkContextMenu('paste-into-folder', 'Read-Only Folder', false);
}; };
/**
* Tests that the Install with Linux menu item is enabled for read-write
* Debian file if Crostini root access is allowed and disabled if not allowed.
*/
testcase.checkInstallWithLinuxStateForDebianFile = async () => {
const optionShown = '#file-context-menu:not([hidden])' +
' [command="#default-task"]:not([hidden]):not([disabled])';
const optionHidden = '#file-context-menu:not([hidden])' +
' [command="#default-task"][disabled][hidden]';
const downloads = '#directory-tree [volume-type-icon="downloads"]';
// Open FilesApp on Downloads with deb file and other file.
const appId = await setupAndWaitUntilReady(
RootPath.DOWNLOADS, [ENTRIES.debPackage, ENTRIES.hello]);
// Ensure menu option "Install with Linux" is shown.
await selectFile(appId, 'package.deb');
await rightClickSelectedFile(appId);
await remoteCall.waitForElement(appId, optionShown);
// Close context menu.
await remoteCall.waitAndClickElement(appId, downloads);
// Select other file, so that menu options for package.deb will be
// reloaded on next select.
await selectFile(appId, 'hello.txt');
// Disallow root access, ensure menu option "Install with Linux" is not shown.
await sendTestMessage({name: 'setCrostiniRootAccessAllowed', enabled: false});
await selectFile(appId, 'package.deb');
await rightClickSelectedFile(appId);
await remoteCall.waitForElement(appId, optionHidden);
// Close context menu.
await remoteCall.waitAndClickElement(appId, downloads);
// Select other file, so that menu options for package.deb will be
// reloaded on next select.
await selectFile(appId, 'hello.txt');
// Allow root access, ensure menu option "Install with Linux" is shown.
await sendTestMessage({name: 'setCrostiniRootAccessAllowed', enabled: true});
await selectFile(appId, 'package.deb');
await rightClickSelectedFile(appId);
await remoteCall.waitForElement(appId, optionShown);
};
/** /**
* Tests that text selection context menus are disabled in tablet mode. * Tests that text selection context menus are disabled in tablet mode.
*/ */
......
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