Commit 18ad3039 authored by Alli Murray's avatar Alli Murray Committed by Commit Bot

Test how partitions are displayed as children of their root label.

Bug: 918795
Change-Id: I3b4d530ad50264a1a9a40b2331b98886e3a81f18
Reviewed-on: https://chromium-review.googlesource.com/c/1457800
Commit-Queue: Alli Murray <alliemurray@google.com>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629893}
parent 37d3f4bb
...@@ -180,7 +180,7 @@ testcase.fileDisplayUsb = async function() { ...@@ -180,7 +180,7 @@ testcase.fileDisplayUsb = async function() {
}; };
/** /**
* Tests files display for partitions on a removable USB volume. * Tests files display on a removable USB volume with and without partitions.
*/ */
testcase.fileDisplayUsbPartition = async function() { testcase.fileDisplayUsbPartition = async function() {
// Open Files app on local downloads. // Open Files app on local downloads.
...@@ -207,13 +207,27 @@ testcase.fileDisplayUsbPartition = async function() { ...@@ -207,13 +207,27 @@ testcase.fileDisplayUsbPartition = async function() {
chrome.test.assertEq( chrome.test.assertEq(
'removable', singleUSB.attributes['volume-type-for-testing']); 'removable', singleUSB.attributes['volume-type-for-testing']);
// Check whether the drive label is shared by the partitions. // Wait for removable root to appear in the directory tree.
chrome.test.assertEq( const removableRoot = await remoteCall.waitForElement(
'PARTITION_DRIVE_LABEL', partitionOne.attributes['drive-label']); appId, '#directory-tree [entry-label="PARTITION_DRIVE_LABEL"]');
chrome.test.assertEq(
'PARTITION_DRIVE_LABEL', partitionTwo.attributes['drive-label']); // Check partitions are children of the root label.
chrome.test.assertEq( const childEntriesQuery =
'SINGLE_DRIVE_LABEL', singleUSB.attributes['drive-label']); ['[entry-label="PARTITION_DRIVE_LABEL"] .tree-children .tree-item'];
const childEntries = await remoteCall.callRemoteTestUtil(
'queryAllElements', appId, childEntriesQuery);
const childEntryLabels =
childEntries.map(child => child.attributes['entry-label']);
chrome.test.assertEq(['partition-1', 'partition-2'], childEntryLabels);
// Check single USB does not have partitions as tree children.
const itemEntriesQuery =
['[entry-label="singleUSB"] .tree-children .tree-item'];
const itemEntries = await remoteCall.callRemoteTestUtil(
'queryAllElements', appId, itemEntriesQuery);
chrome.test.assertEq(1, itemEntries.length);
const childVolumeType = itemEntries[0].attributes['volume-type-for-testing'];
chrome.test.assertTrue('removable' !== childVolumeType);
}; };
/** /**
......
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