Commit e3691030 authored by Jeremie Boulic's avatar Jeremie Boulic Committed by Commit Bot

[Files App] Use mountArchivesInternal_ to mount zip files

When the files-zip-no-nacl flag is enabled, the cros-disks zip handling
is called via mountArchivesInternal_.

Zip integration tests still work: browser_tests --gtest_filter=*zipFile*

Test: Manually tested on DUT
Bug: 912236
Change-Id: I4a5732161f19edd8a10ac5fc4ec280694a1c8415
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2239775Reviewed-by: default avatarFrançois Degros <fdegros@chromium.org>
Commit-Queue: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/master@{#784421}
parent a3ec688e
......@@ -323,7 +323,6 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
FilesAppBrowserTest,
::testing::Values(ZipCase("zipFileOpenDownloads").InGuestMode(),
ZipCase("zipFileOpenDownloads"),
ZipCase("zipFileCannotOpen").ZipNoNaCl(),
ZipCase("zipFileOpenDownloadsShiftJIS"),
ZipCase("zipFileOpenDownloadsMacOs"),
ZipCase("zipFileOpenDownloadsWithAbsolutePaths"),
......
......@@ -835,18 +835,10 @@ class FileTasks {
*/
executeInternalTask_(taskId) {
const actionId = taskId.split('|')[2];
if (actionId === 'mount-archive') {
if (actionId === 'mount-archive' || actionId === 'open-zip') {
this.mountArchivesInternal_();
return;
}
if (actionId === 'open-zip') {
const item = new ProgressCenterItem();
item.id = 'open-zip';
item.message = 'Cannot open zip file: Not implemented yet';
item.state = ProgressItemState.ERROR;
this.progressCenter_.updateItem(item);
return;
}
if (actionId === 'install-linux-package') {
this.installLinuxPackageInternal_();
return;
......
......@@ -116,34 +116,6 @@ testcase.zipFileOpenDownloads = async () => {
await remoteCall.waitForFiles(appId, files);
};
/**
* Tests that trying to mount a ZIP file fails.
*/
testcase.zipFileCannotOpen = async () => {
// Open Files app on Downloads containing a zip file.
const appId = await setupAndWaitUntilReady(
RootPath.DOWNLOADS, [ENTRIES.zipArchive], []);
// Select the zip file.
chrome.test.assertTrue(
!!await remoteCall.callRemoteTestUtil(
'selectFile', appId, ['archive.zip']),
'selectFile failed');
// Press the Enter key.
const key = ['#file-list', 'Enter', false, false, false];
chrome.test.assertTrue(
!!await remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key),
'fakeKeyDown failed');
// Check: an error message should appear.
const element =
await remoteCall.waitForElement(appId, ['#progress-panel', '#open-zip']);
chrome.test.assertEq(
'Cannot open zip file: Not implemented yet',
element.attributes['primary-text']);
};
/**
* Tests zip file, with absolute paths, open (aka unzip) from Downloads.
*/
......
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