Commit 339f6a58 authored by Alli Murray's avatar Alli Murray Committed by Commit Bot

Render file system type in the Type column of the detail table for

removable partitions.

Bug: 918795
Change-Id: I9538461a7d20d9b9d606e4d8f3462c71df018d32
Reviewed-on: https://chromium-review.googlesource.com/c/1460211
Commit-Queue: Alli Murray <alliemurray@google.com>
Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630696}
parent c2ab1176
......@@ -245,6 +245,7 @@ WRAPPED_INSTANTIATE_TEST_CASE_P(
TestCase("fileDisplayMtp"),
TestCase("fileDisplayUsb"),
TestCase("fileDisplayUsbPartition"),
TestCase("fileDisplayPartitionFileTable"),
TestCase("fileSearch"),
TestCase("fileSearch").EnableMyFilesVolume(),
TestCase("fileDisplayWithoutDownloadsVolume").DontMountVolumes(),
......
......@@ -444,6 +444,9 @@ std::unique_ptr<Volume> Volume::CreateForTesting(
volume->is_read_only_ = read_only;
volume->volume_id_ = GenerateVolumeId(*volume);
volume->drive_label_ = drive_label;
if (volume_type == VOLUME_TYPE_REMOVABLE_DISK_PARTITION) {
volume->file_system_type_ = "ext4";
}
return volume;
}
......
......@@ -890,6 +890,12 @@ FileTable.prototype.renderType_ = function(entry, columnId, table) {
['contentMimeType'])[0].contentMimeType;
div.textContent = FileListModel.getFileTypeString(
FileType.getType(entry, mimeType));
// For removable partitions, display file system type.
if (!mimeType && entry.volumeInfo && entry.volumeInfo.diskFileSystemType) {
div.textContent = entry.volumeInfo.diskFileSystemType;
}
return div;
};
......
......@@ -230,6 +230,37 @@ testcase.fileDisplayUsbPartition = async function() {
chrome.test.assertTrue('removable' !== childVolumeType);
};
/**
* Tests partitions display in the file table when root removable entry
* is selected. Checks file system type is displayed.
*/
testcase.fileDisplayPartitionFileTable = async function() {
const removableGroup = '#directory-tree [root-type-icon="removable"]';
// Open Files app on local downloads.
const appId = await setupAndWaitUntilReady(RootPath.DOWNLOADS);
// Mount removable partitions.
await sendTestMessage({name: 'mountFakePartitions'});
// Wait for removable group to appear in the directory tree.
await remoteCall.waitForElement(appId, removableGroup);
// Select the first removable group by clicking the label.
chrome.test.assertTrue(await remoteCall.callRemoteTestUtil(
'fakeMouseClick', appId, [removableGroup]));
// Wait for removable partitions to appear in the file table.
const partitionOne = await remoteCall.waitForElement(
appId, '#file-list [file-name="partition-1"] .type');
console.log(JSON.stringify(partitionOne));
chrome.test.assertEq('ext4', partitionOne.text);
const partitionTwo = await remoteCall.waitForElement(
appId, '#file-list [file-name="partition-2"] .type');
chrome.test.assertEq('ext4', partitionOne.text);
};
/**
* Searches for a string in Downloads and checks that the correct results
* are displayed.
......
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