0
Commit Graph

5377 Commits

Author SHA1 Message Date
Alex Danilo
1dcb478360 Extract: Add support for multiple password dialogs
Adds the logic to allow multiple password dialogs to appear if the
extraction selection contains more than one password encrypted
archive.

Bug: 953256
Change-Id: Ic56af7cd2ef24dc7d1fd2aab0663cacf466d29d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3686842
Reviewed-by: François Degros <fdegros@chromium.org>
Commit-Queue: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1011851}
2022-06-08 08:33:52 +00:00
Noel Gordon
860b52a6de filesapp: prevent console.errors due to Recents in MediaStore filter
Per crbug.com/1333385/#c17 when Android MediaStore is enabled in Files
app, console.errors and /var/log/chrome/chrome LOG(ERROR) can occur if
the user presses any Recents button in the files app UI.

Add a FilesFilter to prevent the error. If the feature is enabled, add
a files filter to remove entry from disallowed volumes.

This fix is a mitigation for now. TODO(RECENTS): consider updating the
directoryModel.RecentContentScanner to handle disallowed volumes.

Bug: 1333385, 1334442
Change-Id: I26501d7ac04bb1a6acdfa05b5322111042d20316
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3694537
Reviewed-by: Alex Danilo <adanilo@chromium.org>
Commit-Queue: François Degros <fdegros@chromium.org>
Reviewed-by: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1011805}
2022-06-08 03:08:45 +00:00
Alex Danilo
a5f2d1cf94 Extract: Open new window with extracted directory visible
Launches a new window pointing at extracted directories.

Changes tests to expect new window opening.

Bug: 953256
Tests: Manually tested on normal and read-only volumes (DUT and simple chrome).
Change-Id: Iaa968f9834bc26834696e835ed8c6a8bd62d2e9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3686707
Commit-Queue: Alex Danilo <adanilo@chromium.org>
Reviewed-by: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1011678}
2022-06-07 21:39:05 +00:00
François Degros
dd2ca0754f [Files App] Hide notification panel when cancelling archive mounting
When cancelling an archive being mounted, just dismiss the visual signal
panel straightaway. The user doesn't want to see it anymore.

BUG=chromium:1238564
TEST=Manual + CQ

Change-Id: I469c228e8f3890160263a782bd847cfd776ff588
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3687817
Commit-Queue: François Degros <fdegros@chromium.org>
Reviewed-by: Marcello Salomao <msalomao@google.com>
Cr-Commit-Position: refs/heads/main@{#1011314}
2022-06-07 07:34:10 +00:00
Noel Gordon
27158c07b5 filesapp: exclude unindexed volumes for Android MediaStore filter
If the 'media-store-files-only' filter is enabled for Android ARC file
picker, do not add Drive, Crostini or GuestOS volumes to the directory
tree, since their volume content is not indexed by the MediaStore.

Bug: 1333385
Change-Id: I071e2eac6569d3700d75d81f8efa2055dce8e9af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3691247
Reviewed-by: François Degros <fdegros@chromium.org>
Commit-Queue: François Degros <fdegros@chromium.org>
Reviewed-by: Alex Danilo <adanilo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1011281}
2022-06-07 04:37:54 +00:00
Noel Gordon
6eec0c833d filesapp: add media-store-files-only filter to FilteredVolumeManager
Files app UI would normally show all user volumes. However, if the ARC
(Android) file picker sets the 'media-store-files-only' filter, retain
volumes that are indexed by Android MediaStore only.

Add unittest fixture for this new filter: filtered volume manager will
remove all volumes except DOWNLOADS and REMOVABLE volumes.

More changes to files app file manager JS code are needed to implement
the remainder of this Android MediaStore feature at app UI level.

Bug: 1333385
Change-Id: Iab5e2e8b027896a199c8a729aa9d49cf408d79b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3691244
Reviewed-by: François Degros <fdegros@chromium.org>
Reviewed-by: Alex Danilo <adanilo@chromium.org>
Commit-Queue: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1011280}
2022-06-07 04:37:34 +00:00
Luciano Pacheco
d94d9dfadf Files app: Add Store in TS
Add the "lib/" folder to host libraries/code used by Files app.

Add the BaseStore implementation to "lib/".

Add the "state/" folder to host the Files app's state management. This
includes: the Store; Action and all Reducers.

Add the Store initialization behind the flag "FilesAppExperimental".

Remove the placeholder "hello.ts".

Bug: b:228112522
Change-Id: I4965fc0377026efb8feb1fbb74bab0537f51f645
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3650690
Commit-Queue: Luciano Pacheco <lucmult@chromium.org>
Reviewed-by: Ben Reich <benreich@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1011220}
2022-06-07 00:34:56 +00:00
Alex Danilo
6bbba62027 Extract: Add test for read only volume
Bug: 953256
Tests: browser_tests --gtest_filter="*zipExtractFromReadOnly*"
Change-Id: I30c12deb002157e00367e4ee285d6a272c96c190
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3690038
Reviewed-by: François Degros <fdegros@chromium.org>
Commit-Queue: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1010986}
2022-06-06 11:00:02 +00:00
Noel Gordon
55e7ded84d filesapp: add media-store-files-only filter to volume manager
The Android (ARC) file picker sets this filter when the requesting ARC
application specifies an OPEN_MEDIA_STORE_FILES action [1].

Files App SelectFileDialogEx C++ code will be changed to add a filter,
called 'media-store-files-only', in a future CL.

[1] See CL:3657346 for the Ash-side Android file picker changes. Note:
OPEN_MEDIA_STORE_FILES means: files indexed by Android MediaStore that
have a permanent content:URI.

Bug: 1333385
Change-Id: I0103863454c3b5df75d3f17b9b65719e5b4515e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3687266
Reviewed-by: Marcello Salomao <msalomao@google.com>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1010976}
2022-06-06 09:03:38 +00:00
Noel Gordon
aeb78f0d66 fusebox: remove Rename and Delete context-menu items in Lacros
When Lacros browser opens files app in open file picker mode, remove
the right-click context-menu Rename and Delete items when the volume
is provided by fusebox [1].

[1] fusebox Rename and Delete FUSE ops are currently not implemented
since they are device "write" operations. fusebox only supports (and needs) "read" operations for the Lacros file picker for now.

Update volume manager JS externs, implementations, mocks, unit tests
to fix closure. getFuseBoxOnlyFilterEnabled() is now required by the
{VolumeManager} interface. Implementors override.

Bug: 1292825, 1327586, 1330833
Change-Id: Ie52a7e9dc94d1135197bbc5af07328d7329bd050
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3691214
Commit-Queue: Noel Gordon <noel@chromium.org>
Reviewed-by: François Degros <fdegros@chromium.org>
Reviewed-by: Alex Danilo <adanilo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1010931}
2022-06-06 04:35:08 +00:00
Bo Majewski
6b3cfb367b [Files]: Move call to chooseEntry to the foreground page.
Bug: 736930
Change-Id: Iddba4d402d45411fd95da7de578213c2715eccc9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3674928
Commit-Queue: Bo Majewski <majewski@chromium.org>
Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1010488}
2022-06-03 08:59:06 +00:00
Alex Danilo
551209eed2 Extract: Enable password unpack for ZIPs
Bug: 953256
Change-Id: I0dfb9d3949ad5d22d1bacb6018e47e219a2c10db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3685550
Reviewed-by: François Degros <fdegros@chromium.org>
Commit-Queue: Alex Danilo <adanilo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1010448}
2022-06-03 05:20:55 +00:00
François Degros
82c4a6447b [Files App] Use Archive icon for .lz and .lzo files
Also normalized the way the different archive types (ZIP, RAR, TAR...)
are displayed in the file list.

BUG=chromium:1238564
TEST=out/Default/chromeos_unittests --gtest_filter="FileIconUtilTest.*"
TEST=out/Default/browser_tests --gtest_filter="ZipFiles/FilesAppBrowserTest.Test/*"
TEST=out/Default/browser_tests --gtest_filter="FileManagerJsTest.FileType"

Change-Id: I61aa1fa8e88aab0df7e8ada21d41115828aad1d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3685689
Reviewed-by: Marcello Salomao <msalomao@google.com>
Commit-Queue: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1010446}
2022-06-03 05:16:26 +00:00
François Degros
7cf7e78547 [Files App] Can open .lz archives
BUG=chromium:1238564
TEST=Manual test that Files App can open .lz archives
TEST=An automated test is coming in CL 3685153

Change-Id: I2c647f9c0924e559ff23ed5af01ee6242c96e3d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3685952
Commit-Queue: François Degros <fdegros@chromium.org>
Reviewed-by: Marcello Salomao <msalomao@google.com>
Cr-Commit-Position: refs/heads/main@{#1010395}
2022-06-03 01:30:37 +00:00
Luciano Pacheco
a2f314ee02 Files app: Add experimental flag
Add flag to guard the experimental features like TS and Store-based
states.

Bug: b:228112818
Change-Id: I9f43c4f5470dc2cb8ee0319b1d293d92f3d5eecf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3685458
Commit-Queue: Ben Reich <benreich@chromium.org>
Auto-Submit: Luciano Pacheco <lucmult@chromium.org>
Reviewed-by: Ben Reich <benreich@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1010081}
2022-06-02 14:22:14 +00:00
Noel Gordon
1ac15eb068 fusebox: add FilteredVolumeManager isFuseBoxOnlyFilterEnabled getter
Bug: 1292825, 1327586, 1330833
Test: browser_tests --gtest_filter="FileManagerJsTest.FilteredVolume*"
Change-Id: I3c4a668c3fb3787e1de7c3928a1d92b599c4a6d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3678760
Reviewed-by: François Degros <fdegros@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1009512}
2022-06-01 09:21:23 +00:00
Xiaocheng Hu
6027904291 Remove internal usage of Event.path
Event.path is a non-standard and deprecated API. This patch removes as
much of its internal usage (*) as possible to help the deprecation.

(*) I can't find out all internal usage, but at least I've verified
that after this patch, if we disable the feature, CQ still passes.

Bug: 1277431
Change-Id: I737a273ec751b9e1ba9a82c9513a8e038c46fb40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3669396
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Mason Freed <masonf@chromium.org>
Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
Reviewed-by: Xiaohui Chen <xiaohuic@chromium.org>
Reviewed-by: John Lee <johntlee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1009198}
2022-05-31 18:56:11 +00:00
minch
f72a70a0b7 dark_mode: Fix tests failure after enabling the feature - part11
This cl fixed the tests failure introduced by crrev.com/c/3656414
after enabling the feature.
Do not inset the bounds of the client vie if it is in tablet mode,
maximized or fullscreened. Adjusted the assertions in tests as well.

Previous failed info can be found at crrev.com/c/3656414/8.

Bug: 1326629
Change-Id: I44ec238dcbc819930ba2385e5f4f31dff19d06aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3675552
Commit-Queue: Min Chen <minch@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1009189}
2022-05-31 18:34:20 +00:00
Aida Zolic
f3065b81ac DLP: Add DlpMetadataProvider class
Adds a dummy DlpMetadataProvider that will be used to retrieve info
about the files' DLP restriction status in order to mark managed files
in the files app.

Bug: 1326469
Change-Id: Ia028aceac102d6bbd2d369d389f6b88250863b51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3653841
Reviewed-by: Aya Elsayed <ayaelattar@chromium.org>
Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
Auto-Submit: Aida Zolic <aidazolic@chromium.org>
Commit-Queue: Aya Elsayed <ayaelattar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1009067}
2022-05-31 13:13:59 +00:00
Marcello Salomao
084ca06ff4 [Files App] Replace undefined generic error strings
Bug: 1326797
Test: CQ
Change-Id: I76a1ccccedf1080ed7d265c9a429b607ce9f9da6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3672084
Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
Commit-Queue: Marcello Salomao <msalomao@google.com>
Cr-Commit-Position: refs/heads/main@{#1008702}
2022-05-30 01:52:28 +00:00
Alex Danilo
e77ecd51f3 Extract: Enable unpack from read only volumes
Checks for read only volumes being used for extract and if so, sets the
destination as the users 'My Files' folder.

Adds the target of the extraction to the feedback panel to display
where the extraction occurred.

Bug: 953256
Tests: browser_tests --gtest_filter="*zipExtractShowPanel*"
Change-Id: I3dd2b0e5444a30956dc43da1e224c4e54c586708
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3670152
Reviewed-by: François Degros <fdegros@chromium.org>
Commit-Queue: Alex Danilo <adanilo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1008201}
2022-05-27 11:19:03 +00:00
Wenbo Jie
312583ebe7 [FilesDarkMode] Check bg color in preview for both light/dark mode
Fix the quick view browser test to support checking background color in
both light and dark mode.

* Add a "isDarkModeEnabled" remote call so JS browser test can check if
dark mode is on or not.
* When checking background color in browser test, check both light and
dark color based on the dark mode flag.

Note: there are also other background color checks in the quick view
test, but the expected colors work for both light/dark modes.

Bug: 1329635
Test: browser_tests --gtest_filter="*FilesAppBrowserTest*QuickView*"
Change-Id: Iba4c09e1de05fdf0e1a4c623133f0709d3c06afa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3668991
Reviewed-by: Ben Reich <benreich@chromium.org>
Commit-Queue: Wenbo Jie <wenbojie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1008161}
2022-05-27 06:55:19 +00:00
Wenbo Jie
a3421f7a44 [FilesRecentFilter] Change filter button order
Use alphabetical order for filter buttons:
All, Audio, Documents, Images, Videos

Bug: 881673
Test: browser_tests --gtest_filter="*FileTypeFiltersController*"
Test: browser_tests --gtest_fitler="*Recents/FilesAppBrowserTest.Test*"
Change-Id: I48608e7c1d7d578139e3c9e781457eafadf8fbd8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3672156
Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
Commit-Queue: Wenbo Jie <wenbojie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1008160}
2022-05-27 06:53:59 +00:00
Marcello Salomao
e5d74c07ee [Files App] Fixes thumbnail image overlapping label
Bug: 1318552
Test: Manually tested that other thumbnails didn't break after changes
Change-Id: If59805d8b0f683c6b390f6d644bb4e0fd8bbfd0e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3672096
Commit-Queue: Marcello Salomao <msalomao@google.com>
Reviewed-by: Bo Majewski <majewski@chromium.org>
Auto-Submit: Marcello Salomao <msalomao@google.com>
Cr-Commit-Position: refs/heads/main@{#1008153}
2022-05-27 06:14:51 +00:00
François Degros
e1bc4cf409 [Files App] Change a few console.error to console.warn
Bug: 1238564
Test: Manual + CQ
Change-Id: I4f505f1ba428052ae3529c2bfc91124973810223
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3670824
Reviewed-by: Marcello Salomao <msalomao@google.com>
Commit-Queue: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1008096}
2022-05-27 01:32:10 +00:00
Marcello Salomao
a83209c157 [Files App] Add testCancelMountingArchive
Bug: 1238564
Test: autoninja -C out/Default/ browser_tests && testing/xvfb.py ./out/Default/browser_tests --gtest_filter="*.VolumeManagerTest"
Change-Id: Ie8f913f0547c4f2d35c2b47218ab70c6882f423e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3670416
Commit-Queue: Marcello Salomao <msalomao@google.com>
Reviewed-by: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1008065}
2022-05-27 00:40:42 +00:00
Bo Majewski
50fbf733ac [Files]: Cleanup: removes unused class field.
CommandController is passed but not used by the ScanController.

Change-Id: I1a74f19c9b4c7b7c5393789f54d11b41f3b05918
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3669921
Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
Commit-Queue: Bo Majewski <majewski@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1007789}
2022-05-26 10:48:02 +00:00
Wenbo Jie
55221c788d Reland "[FilesRecentFilter] Browser tests for delete/rename/cut in Recent"
This is a reland of commit 00d38d4c00.

Add more assertions for renameFile() to make it more stable for msan.

Bug: 1328838

Original change's description:
> [FilesRecentFilter] Browser tests for delete/rename/cut in Recent
>
> A follow-up for CL:3646529, adding browser tests to check:
> * Read-only badge is hidden in the Recents view.
> * Delete/Rename/Cut operation is allowed for files in the Recents view.
> * Rename operation is disabled for ARC files in the Recents view.
> * Deletion for multiple files from different sources is allowed for
>   files in the Recents view.
>
> Bug: 1324048
> Test: browser_tests --gtest_filter="*Recents/FilesAppBrowserTest.Test*"
> Change-Id: I90537481128f378b3094bcbe32d50398f1d9068f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3651886
> Reviewed-by: Alex Danilo <adanilo@chromium.org>
> Commit-Queue: Wenbo Jie <wenbojie@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1006745}

Bug: 1324048
Change-Id: I46d9ac685b66033996b69bd5917fce2aba6dc02e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3664161
Reviewed-by: Alex Danilo <adanilo@chromium.org>
Commit-Queue: Wenbo Jie <wenbojie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1007733}
2022-05-26 05:44:33 +00:00
François Degros
5dc9ec07be [Files App] Don't display error if trying to unmount already-unmounted volume
BUG=chromium:1328640
TEST=Manual test + CQ

Change-Id: I014dc2cdcec32838c709b29277152154899e8cbb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3665078
Reviewed-by: Marcello Salomao <msalomao@google.com>
Commit-Queue: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1007302}
2022-05-25 09:37:10 +00:00
Luciano Pacheco
a962a55868 Files app: Add initial build config for TS
Add a ts_library() in //ui/file_manager/ for the entire Files app,
including background, foreground and the shared worker. This TS
configuration outputs all required JS in a new generated folder "tsc".
The "preprocessed" folder is still used as the input for ts_library().

The 3 builds for Files app (background, foreground and the worker) are
all generated from the new "tsc" folder.

Refactors:
1. Changed Audio Player and Image Loader to use their own
preprocess_if_expr because they're always built from the "preprocessed"
folder instead of the "tsc".
2. Move the list of static and generated JS files to its own files.gni
file to make the BUILD.gn more readable and to be able to reuse the list
between the preprocess_if_expr() and the new ts_library().

The follow up CL shows how to use the TS in the Files app:
https://chromium-review.googlesource.com/c/chromium/src/+/3650690/3

Bug: b:228112761
Change-Id: If1141ec85716356c0a80c9991125fdff8989cb89
Cq-Include-Trybots: luci.chrome.try:chromeos-eve-chrome
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3577936
Reviewed-by: Ben Reich <benreich@chromium.org>
Commit-Queue: Luciano Pacheco <lucmult@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1007232}
2022-05-25 04:48:06 +00:00
François Degros
a318072972 [Files App] Redact PII from mounting-related JS logs
Bug: 1238564
Test: Manual + CQ
Change-Id: I06ed93380258d60b51e2ad93356cf2b2d59a6b08
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3666016
Reviewed-by: Marcello Salomao <msalomao@google.com>
Commit-Queue: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1007222}
2022-05-25 04:10:47 +00:00
François Degros
ecd14c971c [Files App] Redact PII from mounting-related JS logs
Bug: 1238564
Test: Manual + CQ
Change-Id: Ib524655e4c53883db76d801ee4e5f7b680799c68
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3659835
Commit-Queue: François Degros <fdegros@chromium.org>
Reviewed-by: Marcello Salomao <msalomao@google.com>
Cr-Commit-Position: refs/heads/main@{#1007182}
2022-05-25 01:42:14 +00:00
Nina Satragno
10ff88ef65 Revert "[FilesRecentFilter] Browser tests for delete/rename/cut in Recent"
This reverts commit 00d38d4c00.

Reason for revert: tests are crashing

https://ci.chromium.org/ui/p/chromium/builders/ci/linux-chromeos-dbg/28877/test-results?q=ExactID%3Aninja%3A%2F%2Fchrome%2Ftest%3Abrowser_tests%2FFilesAppBrowserTest.Test%2FRecents.recentsAllowRename_FilesSwa_FiltersInRecents_FiltersInRecentsV2+VHash%3A67f47541aa494056

Original change's description:
> [FilesRecentFilter] Browser tests for delete/rename/cut in Recent
>
> A follow-up for CL:3646529, adding browser tests to check:
> * Read-only badge is hidden in the Recents view.
> * Delete/Rename/Cut operation is allowed for files in the Recents view.
> * Rename operation is disabled for ARC files in the Recents view.
> * Deletion for multiple files from different sources is allowed for
>   files in the Recents view.
>
> Bug: 1324048
> Test: browser_tests --gtest_filter="*Recents/FilesAppBrowserTest.Test*"
> Change-Id: I90537481128f378b3094bcbe32d50398f1d9068f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3651886
> Reviewed-by: Alex Danilo <adanilo@chromium.org>
> Commit-Queue: Wenbo Jie <wenbojie@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1006745}

Bug: 1324048
Change-Id: I3426171774100a0d1d3bbc307b5f91cb1429a8c0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3664996
Owners-Override: Nina Satragno <nsatragno@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Nina Satragno <nsatragno@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1006915}
2022-05-24 17:01:22 +00:00
Wenbo Jie
00d38d4c00 [FilesRecentFilter] Browser tests for delete/rename/cut in Recent
A follow-up for CL:3646529, adding browser tests to check:
* Read-only badge is hidden in the Recents view.
* Delete/Rename/Cut operation is allowed for files in the Recents view.
* Rename operation is disabled for ARC files in the Recents view.
* Deletion for multiple files from different sources is allowed for
  files in the Recents view.

Bug: 1324048
Test: browser_tests --gtest_filter="*Recents/FilesAppBrowserTest.Test*"
Change-Id: I90537481128f378b3094bcbe32d50398f1d9068f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3651886
Reviewed-by: Alex Danilo <adanilo@chromium.org>
Commit-Queue: Wenbo Jie <wenbojie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1006745}
2022-05-24 03:11:52 +00:00
Bo Majewski
ff48a734df [Files]: Minor code cleanup.
Removes a left-over reference to self (i.e., this).

Change-Id: Ie1eeccde9f1a94fbe5d88a720351a72be2564e9b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3653350
Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
Commit-Queue: Bo Majewski <majewski@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1006367}
2022-05-23 09:56:30 +00:00
Wenbo Jie
dfae2274b4 [FilesRecentFilter] Support clearing cache for getRecentFiles
* Add a new "invalidateCache" parameter to the private extension API
chrome.fileManagerPrivate.getRecentFiles() so we can explicitly clear
the recent file query cache in the backend.
* Add a new "invalidateCache" parameter to DirectoryModel.rescan() so
it can be passed down to chrome.fileManagerPrivate.getRecentFiles().
* This is useful for when we try to refetch the recent file list right
after deletion. Without this the recent file list will still show the
deleted file if the deletion happens within 10s from the last fetch.

Bug: 1324048
Change-Id: I24bd62c4c3ffefbe35cf3af9e7860a49d48dd9ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3653375
Reviewed-by: Glen Robertson <glenrob@chromium.org>
Reviewed-by: Alex Danilo <adanilo@chromium.org>
Commit-Queue: Wenbo Jie <wenbojie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1006333}
2022-05-23 07:19:49 +00:00
Wenbo Jie
86777003a2 [FilesRecentFilter] Remove read-only badge from Recent view
Remove read-only flag from Recent view so that delete/rename/cut can be
done from Recent view.
* C++ side will return "readonly: false" for ARC roots only if the
feature flag #filters-in-recents-v2 is on.
* In frontend, fake entry is read only by default, we explicitly make
it "readonly: false" if it's RecentEntry.
* Rename for ARC files in Recent is not supported in Android side, so
we disable "Rename" menu for ARC files.
* Recents view now is not read-only, we need to disable the paste
command there because it shouldn't support paste in.

Demo:
* rename: http://shortn/_brxSbhJa8J (except ARC files)
* delete: http://shortn/_UuwuUz0IiJ (can select multiple files from
  different sources)
* cut/paste: http://shortn/_JetilLg7xz (can't select multiple files
  from different folders/sources due to crbug.com/824986)

Note: browser test will come in a follow-up CL, the browser test change
in this CL is just fixing the existing broken tests.

Bug: 1324048
Test: unit_tests --gtest_filter="*ArcDocumentsProviderRootMap*"
Test: browser_tests --gtest_filter="*VolumeManagerTypesTest*"
Test: browser_tests --gtest_filter="*FileManagerCommandsTest*"
Test: browser_tests --gtest_filter="*DirectoryModelTest*"
Test: browser_tests --gtest_filter="*Recents/FilesAppBrowserTest.Test*"
Change-Id: I8d23d0aa5891685e02608262dd0f0c4a4fb2ccf3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3646529
Commit-Queue: Wenbo Jie <wenbojie@chromium.org>
Reviewed-by: David Jacobo <djacobo@chromium.org>
Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1006319}
2022-05-23 06:17:57 +00:00
Ben Reich
1bfec72bb1 [FilesPerf] Pass back the taskId when calling startIOTask
To track performance of the various file operations the taskId is
required to differentiate between ongoing operations of the same type.
For legacy IO tasks this was generated in the UI code but for the new
IOTask framework this is done in C++. Pass the taskId generated back in
a callback when calling startIOTask to ensure the taskId is available to
track performance of both types.

Add this API to the api.js file to make it async/await compatible and
also update all the existing callsites to this version. Note that most
callsites don't currently care about the taskId so make it optional and
don't await it. A follow up CL will keep track of the taskId and
introduce metrics to track per operations metrics.

Bug: 1290197
Test: autoninja -C out/Files ui/file_manager:closure_compile
Change-Id: I4de3b891f410a1b2b16244e145edf3869a1d28e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3654284
Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
Commit-Queue: Ben Reich <benreich@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1006298}
2022-05-23 04:02:38 +00:00
Marcello Salomao
032d6bdf19 [Files app] Add missing slow mounter formats
Some slow mounter formats (XZ, LZMA, Z, ZSTD) were not
appropriately supported on Files App.

displayed and opened +
autoninja -C out/Default/ chromeos_unittests && ./out/Default/chromeos_unittests --gtest_filter="FileIconUtilTest.*"

Bug: 1319765
Test: Manual testing that new archive formats are correctly
Change-Id: If1d4d0cad35ac96cd1ff2d2d2b8da5bcce8d5bf2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3650089
Reviewed-by: François Degros <fdegros@chromium.org>
Commit-Queue: François Degros <fdegros@chromium.org>
Reviewed-by: Xiaoqian Dai <xdai@chromium.org>
Reviewed-by: Nigel Tao <nigeltao@chromium.org>
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1006190}
2022-05-22 01:53:42 +00:00
Wenbo Jie
a26431daa6 [FilesRecentFilter] Support document filter for DriveFS
Add a new field in drivefs.mojom to support query by multiple mime
types, then we can use the document mime type list generated by
file_types.json5 to query DriveFS for all recent documents.

Related google3 CL: http://cl/437673745
Demo: http://shortn/_tfv3yYPLgt

Bug: 881673
Change-Id: Iaa1ccbe8d8c0b734c183b3188afe9adf6e7432bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3581506
Commit-Queue: Wenbo Jie <wenbojie@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Austin Tankiang <austinct@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1005641}
2022-05-20 06:16:12 +00:00
Alex Danilo
505441634f Extract: Add testing for UMA generation
Bug: 953256
Tests: browser_tests --gtest_filter="*zipExtract*"
Change-Id: Ie029b9b53524d42655cfb6ecac4b0aae5917c1a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3653766
Commit-Queue: Alex Danilo <adanilo@chromium.org>
Reviewed-by: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1005591}
2022-05-20 02:36:01 +00:00
Marcello Salomao
31bd66bfff [Files app] Redact PII from mounting-related JS logs
console.warn logs end up in /var/log/chrome/chrome, but
console.debug logs don't. So we split warn logs into 2,
keeping warning messages for engineers debugging with
dev tools but redacting any PII from it.

Bug: 1238564
Test: Manual + CQ
Change-Id: I4130f31c4c458ae114fa4764a7996ffb1aea8ed0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3653645
Commit-Queue: François Degros <fdegros@chromium.org>
Reviewed-by: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1005060}
2022-05-19 01:42:20 +00:00
Alex Danilo
b3aa1d58c8 Extract: Add test for insufficient disk space
Adds a test ZIP file that claims to need 120TB to unpack.

Checks that insufficient disk space for extraction fails the extraction
operation

Bug: 953256
Change-Id: I12d365c0bc75e864a20c0cf0bdbc217b5b789fe0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3649903
Commit-Queue: Alex Danilo <adanilo@chromium.org>
Reviewed-by: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1003664}
2022-05-16 08:51:28 +00:00
Marcello Salomao
d5c0c90eaa Reland "[Files App] Fix error handling in volume_manager_impl.js"
This is partial a reland of commit 147b3c9507

In addition to the original code, a second patchset was added
that removes the chrome.runtime.lastError checking from one
of the tests where the error is actually
expected/tolerated/ignored.

Original change's description:
> [Files App] Fix error handling in volume_manager_impl.js
>
> Currently, some methods in volume_manager_impl.js aren't checking
> for synchronous errors coming from FileManagerPrivateAPI. We are
> addressing this so chrome.runtime.lastError messages aren't left
> unchecked in case some of such errors are triggered.
>
> Bug: 1238564
> Test: CQ
>
> Cq-Depends: 3631859
> Change-Id: Ibfa0e6056c6066bdf31bb70e1562ffc377509883
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3637077
> Auto-Submit: Marcello Salomao <msalomao@google.com>
> Reviewed-by: François Degros <fdegros@chromium.org>
> Commit-Queue: François Degros <fdegros@chromium.org>
> Commit-Queue: Marcello Salomao <msalomao@google.com>
> Cr-Commit-Position: refs/heads/main@{#1002396}

Bug: 1238564
Change-Id: Ie5b85d3f987cd7425a361992ed6696f2262a9318
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3647108
Reviewed-by: François Degros <fdegros@chromium.org>
Commit-Queue: Marcello Salomao <msalomao@google.com>
Commit-Queue: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1002995}
2022-05-13 04:58:33 +00:00
Mohamed Amir Yosef
2540784607 Revert "[Files App] Fix error handling in volume_manager_impl.js"
This reverts commit 147b3c9507.

Reason for revert: Suspect culprit for https://crbug.com/1324883

Original change's description:
> [Files App] Fix error handling in volume_manager_impl.js
>
> Currently, some methods in volume_manager_impl.js aren't checking
> for synchronous errors coming from FileManagerPrivateAPI. We are
> addressing this so chrome.runtime.lastError messages aren't left
> unchecked in case some of such errors are triggered.
>
> Bug: 1238564
> Test: CQ
>
> Cq-Depends: 3631859
> Change-Id: Ibfa0e6056c6066bdf31bb70e1562ffc377509883
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3637077
> Auto-Submit: Marcello Salomao <msalomao@google.com>
> Reviewed-by: François Degros <fdegros@chromium.org>
> Commit-Queue: François Degros <fdegros@chromium.org>
> Commit-Queue: Marcello Salomao <msalomao@google.com>
> Cr-Commit-Position: refs/heads/main@{#1002396}

Bug: 1238564
Change-Id: I9151ef71032b550e06cff0f063202276aef3f8d2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3643836
Auto-Submit: Mohamed Amir Yosef <mamir@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Mohamed Amir Yosef <mamir@chromium.org>
Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1002618}
2022-05-12 14:09:50 +00:00
Marcello Salomao
147b3c9507 [Files App] Fix error handling in volume_manager_impl.js
Currently, some methods in volume_manager_impl.js aren't checking
for synchronous errors coming from FileManagerPrivateAPI. We are
addressing this so chrome.runtime.lastError messages aren't left
unchecked in case some of such errors are triggered.

Bug: 1238564
Test: CQ

Cq-Depends: 3631859
Change-Id: Ibfa0e6056c6066bdf31bb70e1562ffc377509883
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3637077
Auto-Submit: Marcello Salomao <msalomao@google.com>
Reviewed-by: François Degros <fdegros@chromium.org>
Commit-Queue: François Degros <fdegros@chromium.org>
Commit-Queue: Marcello Salomao <msalomao@google.com>
Cr-Commit-Position: refs/heads/main@{#1002396}
2022-05-11 23:47:29 +00:00
Marcello Salomao
fa522544e7 [Files app] Call cancelMounting on cancel button press
Bug: 1238564
Test: CQ + manual testing

Change-Id: I1f53acb393cd6bed61c61b2cadc476b6d116fc1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3632138
Auto-Submit: Marcello Salomao <msalomao@google.com>
Commit-Queue: François Degros <fdegros@chromium.org>
Reviewed-by: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1001953}
2022-05-11 07:59:54 +00:00
Wenbo Jie
c2b322b087 [Files] Fix TestEntryInfo related types
A follow-up for CL:3616554:
Make the test util function type more explicit, and fix type checking
failures after the change.

Bug: 881673
Change-Id: Ib48c880d4392a9b61cdb21f86d3c43845953b003
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3626859
Commit-Queue: Wenbo Jie <wenbojie@chromium.org>
Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1001283}
2022-05-10 01:28:59 +00:00
Wenbo Jie
c99a5e7a92 Reland "[FilesRecentFilter] Add integration test for ARC source"
This is a reland of commit 5e5524b3f9.
The was reverted because it depends on CL:3596676 which has been
reverted. The reland of CL:3596676 is here CL:3631739.

Original change's description:
> [FilesRecentFilter] Add integration test for ARC source
>
> Add integration tests for recent filter on ARC source (Play Files):
>   * All types of files in Play Files should be shown in recents.
>   * Images/Videos/Documents files in Play Files should be shown
>   separately if a specific filter is selected.
>   * Audio files in Play Files shouldn't be shown because audio_root
>   is not supported.
>
> This CL also includes changes:
> * browsertest_base in backend:
>   * Add support to mount documents_root.
>   * When creating entries for media view root, we also need to
>   explicitly add the document to the recent document list, otherwise
>   the newly added files won't be picked up for Recents in the fake
>   ARC file system.
> * test_util in frontend:
>   * Create a new function for TestEntryInfo so we can generate new
>   entry based on the existing one but with a new lastModifiedTime
>   field. This is useful for constructing file entries for Recents view.
>   * Add a util function to generate a random date within last 30 days
>   so we can use it to generate dates which are eligible for Recents
>   view.
>
> Bug: 881673
> Test: browser_tests -gtest_filter=
> "*Recents/FilesAppBrowserTest.Test*PlayFiles*"
>
> Change-Id: If86e2148081ad486e5b2e5e4d0298391e41fac7a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3616554
> Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
> Commit-Queue: Wenbo Jie <wenbojie@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1000168}

Bug: 881673
Change-Id: Iaa5415f38e06bcc43bbdedaa214d68a2ff9edec9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3631958
Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
Commit-Queue: Wenbo Jie <wenbojie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1001250}
2022-05-09 23:51:56 +00:00
Wenbo Jie
b78ddd0d63 Reland "[FilesRecentFilter] Documents filter for ARC"
This is a reland of commit 26edf35011.
The original revert was related to a test failure in VolumeManager,
the root cause is the assertion of "event.success" is not available
on Msan platform. In this reland, the assertion of "event.success"
is being removed, check the diff between patchset 1 and patchset 2.

Also, 2 Msan related try jobs have been added to presubmit check to
make sure the change works.

Original change's description:
> [FilesRecentFilter] Documents filter for ARC
>
> Support documents_root in RecentArcMediaSource:
> * Add documents_root to the arc_documents_provider.
> * Register the new root in the volume_manager.
> * Refactor: remove all hard-code root string and use constants from
> arc_media_view_util.
>
> Note: this feature only works with ARCVM (android 11), because that's
> when Android's MediaDocumentsProvider.queryRecentDocuments()
> introduces documents_root support. For ARC++ containers, no files will
> return for documents_root.
>
> Demo: http://shortn/_ezNIvqcryC
> Demo for Android 9: http://shortn/_4Xooka3i1J (image/video filters still
> work, but the document file .doc is not showing in the All/Documents
> filter)
>
> folders and restart chromebook, then check the newly created files
> should appear in Recents document filter
>
> Bug: 881673
> Test: unit_tests --gtest_filter="*RecentArcMediaSourceTest*"
> Test: unit_tests --gtest_filter="*VolumeManagetTest*"
> Test: unit_tests --gtest_filter="*FileManagerPathUtilTest*"
> Test: manually create doc files (e.g. txt/pdf/doc) in the "Play files"
> Change-Id: I98679e48c59560799deb05bbf9351885e9157079
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3596676
> Commit-Queue: Wenbo Jie <wenbojie@chromium.org>
> Reviewed-by: Austin Tankiang <austinct@chromium.org>
> Reviewed-by: David Jacobo <djacobo@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#999778}

Bug: 881673
Change-Id: I67f29fc795af3af16bbcf6c8dbcc659a89b79841
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3631739
Reviewed-by: Austin Tankiang <austinct@chromium.org>
Commit-Queue: Wenbo Jie <wenbojie@chromium.org>
Reviewed-by: David Jacobo <djacobo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1000884}
2022-05-09 06:23:40 +00:00