Commit a36ecd57 authored by Stuart Langley's avatar Stuart Langley Committed by Commit Bot

[filesapp]: Move ENTRY_SET definitions from gear_menu test to common location.

- Change how arrays that are composed of other arrays are defined.
- Fix some closure markup at while I'm here.

Bug: 894342
Change-Id: I10355a93c6a5fae24a8626cd69a392158bdeba0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1935667
Commit-Queue: Stuart Langley <slangley@chromium.org>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718973}
parent 03b184f8
...@@ -54,6 +54,16 @@ const BASIC_LOCAL_ENTRY_SET = [ ...@@ -54,6 +54,16 @@ const BASIC_LOCAL_ENTRY_SET = [
ENTRIES.photos, ENTRIES.photos,
]; ];
/**
* Expected files shown in Downloads with hidden enabled
*
* @type {!Array<!TestEntryInfo>}
* @const
*/
const BASIC_LOCAL_ENTRY_SET_WITH_HIDDEN = BASIC_LOCAL_ENTRY_SET.concat([
ENTRIES.hiddenFile,
]);
/** /**
* Basic entry set for the drive volume that only includes read-write entries * Basic entry set for the drive volume that only includes read-write entries
* (no read-only or similar entries). * (no read-only or similar entries).
...@@ -78,6 +88,32 @@ const BASIC_DRIVE_ENTRY_SET = [ ...@@ -78,6 +88,32 @@ const BASIC_DRIVE_ENTRY_SET = [
ENTRIES.testSharedFile, ENTRIES.testSharedFile,
]; ];
/**
* Expected files shown in Drive with hidden enabled
*
* @type {!Array<!TestEntryInfo>}
* @const
*/
const BASIC_DRIVE_ENTRY_SET_WITH_HIDDEN = BASIC_DRIVE_ENTRY_SET.concat([
ENTRIES.hiddenFile,
]);
/**
* Expected files shown in Drive with Google Docs disabled
*
* @type {!Array<!TestEntryInfo>}
*/
const BASIC_DRIVE_ENTRY_SET_WITHOUT_GDOCS = [
ENTRIES.hello,
ENTRIES.world,
ENTRIES.desktop,
ENTRIES.beautiful,
ENTRIES.photos,
ENTRIES.unsupported,
ENTRIES.testSharedFile,
];
/** /**
* Basic entry set for the local crostini volume. * Basic entry set for the local crostini volume.
* @type {!Array<!TestEntryInfo>} * @type {!Array<!TestEntryInfo>}
...@@ -198,6 +234,9 @@ const SHARED_DRIVE_ENTRY_SET = [ ...@@ -198,6 +234,9 @@ const SHARED_DRIVE_ENTRY_SET = [
/** /**
* Entry set for Drive that includes Computers, including nested computers with * Entry set for Drive that includes Computers, including nested computers with
* files and nested "USB and External Devices" with nested devices. * files and nested "USB and External Devices" with nested devices.
*
* @type {Array<TestEntryInfo>}
* @const
*/ */
let COMPUTERS_ENTRY_SET = [ let COMPUTERS_ENTRY_SET = [
ENTRIES.hello, ENTRIES.hello,
...@@ -206,6 +245,31 @@ let COMPUTERS_ENTRY_SET = [ ...@@ -206,6 +245,31 @@ let COMPUTERS_ENTRY_SET = [
ENTRIES.computerAdirectoryA, ENTRIES.computerAdirectoryA,
]; ];
/**
* Basic entry set for the android volume.
*
* @type {Array<TestEntryInfo>}
* @const
*/
const BASIC_ANDROID_ENTRY_SET = [
ENTRIES.directoryDocuments,
ENTRIES.directoryMovies,
ENTRIES.directoryMusic,
ENTRIES.directoryPictures,
];
/**
* Expected files shown in Android with hidden enabled
*
* @type {!Array<!TestEntryInfo>}
* @const
*/
const BASIC_ANDROID_ENTRY_SET_WITH_HIDDEN = BASIC_ANDROID_ENTRY_SET.concat([
ENTRIES.hello,
ENTRIES.world,
ENTRIES.directoryA,
]);
/** /**
* Opens a Files app's main window. * Opens a Files app's main window.
* *
......
...@@ -4,85 +4,6 @@ ...@@ -4,85 +4,6 @@
'use strict'; 'use strict';
/**
* Expected files shown in Downloads with hidden disabled
*
* @type {!Array<!TestEntryInfo>}
*/
const BASIC_LOCAL_ENTRY_SET_WITHOUT_HIDDEN = [
ENTRIES.hello,
ENTRIES.world,
ENTRIES.desktop,
ENTRIES.beautiful,
ENTRIES.photos,
ENTRIES.crdownload,
];
/**
* Expected files shown in Downloads with hidden enabled
*
* @type {!Array<!TestEntryInfo>}
*/
const BASIC_LOCAL_ENTRY_SET_WITH_HIDDEN = [
ENTRIES.hello,
ENTRIES.world,
ENTRIES.desktop,
ENTRIES.beautiful,
ENTRIES.photos,
ENTRIES.crdownload,
ENTRIES.hiddenFile,
];
/**
* Expected files shown in Drive with hidden enabled
*
* @type {!Array<!TestEntryInfo>}
*/
const BASIC_DRIVE_ENTRY_SET_WITH_HIDDEN = [
ENTRIES.hello,
ENTRIES.world,
ENTRIES.desktop,
ENTRIES.beautiful,
ENTRIES.photos,
ENTRIES.unsupported,
ENTRIES.testDocument,
ENTRIES.testSharedDocument,
ENTRIES.testSharedFile,
ENTRIES.hiddenFile,
];
const BASIC_ANDROID_ENTRY_SET = [
ENTRIES.directoryDocuments,
ENTRIES.directoryMovies,
ENTRIES.directoryMusic,
ENTRIES.directoryPictures,
];
const BASIC_ANDROID_ENTRY_SET_WITH_HIDDEN = [
ENTRIES.directoryDocuments,
ENTRIES.directoryMovies,
ENTRIES.directoryMusic,
ENTRIES.directoryPictures,
ENTRIES.hello,
ENTRIES.world,
ENTRIES.directoryA,
];
/**
* Expected files shown in Drive with Google Docs disabled
*
* @type {!Array<!TestEntryInfo>}
*/
const BASIC_DRIVE_ENTRY_SET_WITHOUT_GDOCS = [
ENTRIES.hello,
ENTRIES.world,
ENTRIES.desktop,
ENTRIES.beautiful,
ENTRIES.photos,
ENTRIES.unsupported,
ENTRIES.testSharedFile,
];
/** /**
* Gets the common steps to toggle hidden files in the Files app * Gets the common steps to toggle hidden files in the Files app
* @param {!Array<!TestEntryInfo>} basicSet Files expected before showing hidden * @param {!Array<!TestEntryInfo>} basicSet Files expected before showing hidden
...@@ -172,8 +93,7 @@ testcase.showHiddenFilesDownloads = async () => { ...@@ -172,8 +93,7 @@ testcase.showHiddenFilesDownloads = async () => {
RootPath.DOWNLOADS, BASIC_LOCAL_ENTRY_SET_WITH_HIDDEN, []); RootPath.DOWNLOADS, BASIC_LOCAL_ENTRY_SET_WITH_HIDDEN, []);
await runHiddenFilesTest( await runHiddenFilesTest(
appId, BASIC_LOCAL_ENTRY_SET_WITHOUT_HIDDEN, appId, BASIC_LOCAL_ENTRY_SET, BASIC_LOCAL_ENTRY_SET_WITH_HIDDEN);
BASIC_LOCAL_ENTRY_SET_WITH_HIDDEN);
}; };
/** /**
......
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