summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2025-09-18[SP 2025-09-01] Trim the application name to make it safe for presentationbanksia-dev Ben Reich
The application name is presented in the ConfirmFragment and as such we don't want to allow for any length. This follows a similar approach to PackageManager using the TextUtils.makeSafeForPresentation with a total available character length of 500. This removes the unused getCallingAppName from the DirectoryFragment as it was causing false positives from DirectoryFragment to avoid false positives when trying to find who calls the Shared function. On top of this, add some quotation marks around the app name to avoid the app name being a contination of the existing text in the dialog, e.g. 'This will let app name access current and future content storage in Alarms' will now be 'This will let "app name" access current and future content storage'. Bug: 397216537 Test: atest com.android.documentsui.picker.ApplicationNameTest Flag: EXEMPT bug fix Change-Id: Iad0d03de09b1e4ad953bd6bd46a619cfcc56d384 (cherry picked from commit c8ef2db3bb4645704384226976e59583b9e8d3d3)
2025-03-20Merge "Revert "Modernize ArchiveHandleTest"" into main Treehugger Robot
2025-03-20Merge "[DocsUI Peek] Initial Peek overlay and view manager" into main Jeremie Boulic
2025-03-20Revert "Modernize ArchiveHandleTest" Ben Reich
This reverts commit 8c5c3c4046b546e7655e5877ee3f574058a2f028. Reason for revert: As mentioned we don't know if this works on Android 11-13 which DocumentsUI requires to support. Change-Id: If85391a87532b782d77435034eb7ea5d506fc77e
2025-03-20Merge "Add the job progress panel" into main Austin Tankiang
2025-03-20Merge "Modernize ArchiveHandleTest" into main Treehugger Robot
2025-03-19Merge "[DocsUI M3] Fix DirectoryListBot when M3 enabled" into main Jeremie Boulic
2025-03-20Add the job progress panel Austin Tankiang
This panel is displayed on click of the job toolbar icon. This also changes the context passed into files.MenuManager to be the activity context as the application context doesn't have the theme information required for JobPanelController to inflate layouts. Bug: 385841754 Test: atest -c 'DocumentsUIGoogleTests:com.android.documentsui.JobPanelUiTest' Flag: com.android.documentsui.flags.visual_signals_ro Change-Id: Idd95bd97863892407ed740b3ff8a013408e37b6a
2025-03-19Modernize ArchiveHandleTest François Degros
Use try-with-resources statements where the linter suggests them. Avoid calling methods having a @NonNull-annotated parameter with a null argument, because this causes the linter to complain. Bug: 404658729 Flag: EXEMPT only changed test code Test: atest DocumentsUIGoogleTests:com.android.documentsui.archives Change-Id: I8d2d98c295ee2e90765c19a8e6b11645b62382e0
2025-03-19[DocsUI Peek] Initial Peek overlay and view manager Jeremie Boulic
Define the initial Peek fragment, with its associated layout. If Peek is enabled, the PeekViewManager, instantiated when DocsUI is launched, loads the PeekFragment (with its inflated view) in its hidden container. Flag: com.android.documentsui.flags.use_material3 Flag: com.android.documentsui.flags.use_peek_preview_ro Test: DocumentsUIGoogleTests:com.android.documentsui.peek.PeekUiTest Test: DocumentsUIGoogleTests:c.a.d.files.ActionHandlerTest#testShowPeek Bug: 382163291 Bug: 382163274 Change-Id: I7fdd1afd856803091425b8257b69206746530989
2025-03-18[DocsUI M3] Fix DirectoryListBot when M3 enabled Jeremie Boulic
The DirectoryListBot implements "selectDocument" for functional test, relying on the document's icon as a click location. Update the icon ID based on the changes made in ag/31870100. The icon_wrapper that we now rely on is also available in list mode, when M3 is enabled. Flag: com.android.documentsui.flags.use_material3 Test: com.android.documentsui.*UiTest Bug: 381962394 Change-Id: I2d835857ac7431b8a68491ba7d05bb27f7567f52
2025-03-17Merge "Add job progress icon to the app bar" into main Austin Tankiang
2025-03-17Merge "Fix up TrampolineActivityTest and make activity closing more robust" ↵ Treehugger Robot
into main
2025-03-17Merge "[DocsUI] Click search chip should reset scroll view" into main Wenbo Jie (介文博)
2025-03-18Fix up TrampolineActivityTest and make activity closing more robust Ben Reich
The current TrampolineActivityTest relies on the activity monitor to close any activities that were found. Unfortunately when 2 activities are shown OR one flakes, it has a knock on effect to the remainder tests and causes them to fail. Instead of this, let's get the current active tasks and close any that are from the documentsui or photopicker package. On top of this the extra_mime_types were being added singularly instead of as a string array. This meant that although it showed them as appearing to have multiple mime types only one was being added. Bug: 377771195 Fix: 401787099 Fix: 401466309 Fix: 400612295 Fix: 401786574 Fix: 398402760 Test: atest com.android.documentsui.TrampolineActivityTest Flag: com.android.documentsui.flags.redirect_get_content_ro Change-Id: Ia3f31e5f34da6758930dd3739785fd0cca330209
2025-03-17Merge "[DocsUI, Search]: Adds tests for SearchV2." into main Bo Majewski
2025-03-17Add job progress icon to the app bar Austin Tankiang
This adds a progress indicator to the app bar showing total progress of running jobs. It is not yet interactable. Bug: 385840940 Test: atest -c 'DocumentsUIGoogleTests:com.android.documentsui.JobPanelControllerTest' Flag: com.android.documentsui.flags.visual_signals_ro Change-Id: I9d81a0f36500c2239b7c7007efb3b1aae98467eb
2025-03-14[DocsUI] Click search chip should reset scroll view Wenbo Jie
When we have too many search chips which can't be display in one screen (e.g. on compact size screen), clicking the chip should reset the horizontal scroll view so the checked chip can be seen. Check the attached bug for the before/after comparison. Bug: 403433043 Test: m DocumentsUIGoogle && manual inspection Test: atest DocumentsUIGoogleTests:com.android.documentsui.queries.SearchChipViewManagerTest#testChipChecked_resetScroll Flag: com.android.documentsui.flags.use_material3 Change-Id: Ib0bcd7295953940215c967e021f8ca96e465d6f1
2025-03-14[DocsUI, Search]: Adds tests for SearchV2. Bo Majewski
This CL creates 2 private method that hold test body and calls them from 4 different tests with the mix of search_v2_read_only disabled and enabled. Bug: 380988442 Test: m DocumentsUIGoogle Flag: com.android.documentsui.flags.use_search_v2_read_only Change-Id: Id5f3f49f44bd9c06d122e6a68065a1b04cc57a17
2025-03-13Properly handle x-profile checks Tyler Saunders
Bug: b/402367358 Test: atest DocumentsUITests Flag: EXEMPT bug_fix Change-Id: I79d9fc9e11940b478534e2fc226012ca4064f6b2
2025-03-13[DocsUI M3] Restyle drag drop badge for M3 Wenbo Jie
* When there are multiple dragging files: * add an additional drag layer * add a file counter * Update drag show (radius/offset) to match the new M3 spec. * drag shadow view is an isolated view without the theme context, so M3 color attributes like "?attr/colorXXX" can't be used directly, instead, system color tokens are being used in light/dark mode. Since system color tokens are only available in SDK 31, fallback static colors are being used in the original colors.xml. Check the attached bug for demo. Bug: 377771158 Test: m DocumentsUIGoogle && manual inspection Flag: com.android.documentsui.flags.use_material3 Change-Id: Ia00bb0037a19813b4137d9d6cd7a42441b7f255e
2025-03-10Merge "Remove use_search_v2_rw and introduce use_search_v2_read_only" into main Treehugger Robot
2025-03-11Control visibility of 'Browse' and 'Extract here' menu items François Degros
These menu items are visible when the selection contains exactly one file that is also a supported archive. Bug: 400830188 Bug: 400829875 Flag: com.android.documentsui.flags.use_material3 Flag: com.android.documentsui.flags.zip_ng_ro Test: atest DocumentsUIGoogleTests:com.android.documentsui.picker.MenuManagerTest Test: atest DocumentsUIGoogleTests:com.android.documentsui.files.MenuManagerTest Change-Id: I5fb649a462472a7df69aec3d016b61a35d670c2a
2025-03-11Remove use_search_v2_rw and introduce use_search_v2_read_only Ben Reich
Fix: 400475579 Test: m all_aconfig_declarations | grep use_search_v2_read_only Flag: com.android.documentsui.flags.use_search_v2_read_only Change-Id: I07e5a0d5f631deb4148947b79e5f1d3be4375ada
2025-03-07Control visibility of 'Browse' and 'Extract here' menu items François Degros
Start putting in place the infrastructure that will control the visibility of these menu items. These menu items are not visible yet. Bug: 400830188 Bug: 400829875 Flag: com.android.documentsui.flags.use_material3 Flag: com.android.documentsui.flags.zip_ng_ro Test: atest DocumentsUIGoogleTests:com.android.documentsui.picker.MenuManagerTest Test: atest DocumentsUIGoogleTests:com.android.documentsui.files.MenuManagerTest Change-Id: Ifdd82057e1f988965b3057ac26f7296bc6219f0f
2025-03-06Merge "Broadcast the progress of Jobs" into main Austin Tankiang
2025-03-06Broadcast the progress of Jobs Austin Tankiang
Instead of using the per process monitor, create a new global one. This to collate all job progress into one broadcast. Also add tests for job progress. Do it in this CL, as the CL introducing functions to get progress will get optimized out as the code wasn't used. Bug: 385841586 Test: atest -c 'DocumentsUIGoogleTests:com.android.documentsui.services' Flag: com.android.documentsui.flags.visual_signals_ro Change-Id: Ib0df69a303dbe8bf3ebd0c337491dc48fef0b87f
2025-03-05Fix getCanForwardToProfileIdMapInternal implementation to resolve cross ↵ Tyler Saunders
profile access. * Ensure that CrossProfileIntentForwarderActivity resolution is accurate. This relies on the @hide property `targetUserId` by accessing it via reflection as there is no API that can surface this information for `module_current` targets. * Add test cases for devices that may be configured to have more than one managed profile, and may not be compatible with AOSP source code assumption to ensure CrossProfile detection fails closed. Bug: b/394231676 Test: atest MediaProviderTests:UserManagerStateTest Flag: EXEMPT bugfix Change-Id: Id2a452e29218f9625d32a081ec8f0cf8508d2a0b
2025-03-04Merge "Update multiple flags to read-only" into main Treehugger Robot
2025-03-04Update multiple flags to read-only Ben Reich
This updates the following flags to be read-only - zip_ng -> zip_ng_ro - desktop_file_handling -> desktop_file_handling_ro - visual_signals -> visual_signals_ro - hide_roots_on_desktop -> hide_roots_on_desktop_ro - use_peek_preview -> use_peek_preview_ro It also removes the existing preupload check. Unfortunately this check doesn't work on kotlin files so it's kind of only semi-useful. Bug: 400475579 Test: m DocumentsUIGoogle Flag: EXEMPT update flags to be read-only Change-Id: I117a0e460beb488313ece178349058f5aa2e956e
2025-03-03Merge "[DocsUI M3] Add unit test for filter bar icons" into main Wenbo Jie (介文博)
2025-03-03Merge "Add test for visibility of "Extract all" menu item" into main Treehugger Robot
2025-03-03Merge "Extract flags into their own Util class" into main Treehugger Robot
2025-03-03Merge "Add functions to Jobs to retrieve current progress" into main Austin Tankiang
2025-03-03Extract flags into their own Util class Ben Reich
The flags are all currently spread out across the codebase. This means if we want to do any large scale changes based on them (e.g. change the flag name OR union the flag with some other condition) it requires a mass refactoring. Let's move the flags into their own class so this becomes a much easier process. To avoid additional usages getting added, create a presubmit check that should error when new dependencies are added Bug: 400475579 Flag: EXEMPT Moving flags into a helper class Test: m DocumentsUIGoogle Change-Id: If5c346141813afb68b24e1303362408c3cc9fd4a
2025-03-03Add functions to Jobs to retrieve current progress Austin Tankiang
There is no change in behaviour as this patch just adds functions. Due to limitations in the current job implementations, there are a few shortcominings: * Failure reasons aren't exposed. * Transfers of zero bytes (e.g. folder only or empty file) show as indeterminate progress. * In cases where file size can't be determined, the job keeps track via files processed, but these will show as indeterminate progress. Bug: 385841721 Test: atest -c 'DocumentsUIGoogleTests:com.android.documentsui.services' Flag: com.android.documentsui.flags.visual_signals Change-Id: I7b0d863bf7b974090c0e1a17f06c0f7160c59699
2025-03-03Add test for visibility of "Extract all" menu item François Degros
Bug: 394675058 Flag: com.android.documentsui.flags.zip_ng Test: atest DocumentsUIGoogleTests:com.android.documentsui.picker.MenuManagerTest Change-Id: I45995641218db1b8be106bee0a1780caa9ec2aeb
2025-03-02Merge "Add test for visibility of "Extract all" menu item" into main Treehugger Robot
2025-03-03[DocsUI M3] Add unit test for filter bar icons Wenbo Jie
Bug: 398996996 Test: m DocumentsUIGoogle && manual inspection Flag: com.android.documentsui.flags.use_material3 Change-Id: I2f5c23450a88dfadad21aa413178799c4a2fa738
2025-03-02Merge "Remove redirect_get_content and add read-only variant" into main Treehugger Robot
2025-03-02Fix RenameDocumentUitest#testRenameFile_Cancel Ben Reich
For some reason the onView().perform() logic that is present in the clickDialogCancelButton is not clicking the actual button. This is leading to the test just leaving the dialog staying on the screen and the test being unable to find the directoy list. Instead let's update it to use UiObject2 and perform the click, this seems more stable across Android versions. Fix: 385439355 Bug: 394151244 Flag: EXEMPT test fix Test: atest RenameDocumentUiTest#testRenameFile_Cancel Change-Id: Ib86d26a2f9c1f1ed24ae9270d4c7b448be9267bc
2025-02-28Merge "Fix RenameDocumentUiTest#testRenameFile_OkButton" into main Treehugger Robot
2025-02-28Remove redirect_get_content and add read-only variant Ben Reich
Turns out when I added this flag initially I forgot the is_fixed_read_only property. This has inadvertently caused the AndroidManifest.xml to retain the key android:featureFlag against the TrampolineActivity. When I change it to read-only, it actually compiles the property out of the AndroidManifest and retains one or the other. Unfortunately flags which incorrectly set this property can't be updated, they have to be abandoned. So let's use redirect_get_content_ro to fix this mishap. http://ag/32017425 is rolling the existing flag back, so will submit this CL once that has landed. Bug: 377771195 Flag: com.android.documentsui.flags.redirect_get_content_ro Test: atest com.android.documentsui.picker.TrampolineActivityTest Change-Id: I4e41c0ab87ebc59272faef5351fefddbf5873654
2025-02-28Fix up crash in MenuManager when selection is active Ben Reich
When the menus have been moved from the ActionBar to the NavigationView it means the menu updating code no longer retrieves the menu from the BaseActivity. There was some code that was causing a crash on paste in as it was trying to use the old update path instead. Opt for the new update method when the flag is enabled instead. This also adds a regression test that expectedly fails currently but with the fix will succeed, this also should pass with or without the flag on. Fix: 399752575 Bug: 383669583 Flag: com.android.documentsui.flags.use_material3 Test: atest testKeyboard_PasteDocumentWhileSelectionActive Change-Id: Ic83e1239abee824360a11075ee24c49274f57318
2025-02-28Add test for visibility of "Extract all" menu item François Degros
Bug: 394675058 Flag: com.android.documentsui.flags.zip_ng Test: atest DocumentsUIGoogleTests:com.android.documentsui.files.MenuManagerTest Change-Id: I0344f2aecd14ad6e9853e6157ca6ee1d51e5c7db
2025-02-28Fix RenameDocumentUiTest#testRenameFile_OkButton Ben Reich
For some reason the onView().perform() logic that is present in the clickDialogOkButton is not clicking the actual button. This is leading to the test just dismissing the dialog instead of actioning it. Instead let's update it to use UiObject2 and perform the click, this seems more stable across Android versions. Bug: 394151244 Bug: 384582399 Test: atest RenameDocumentUiTest#testRenameFile_OkButton Flag: EXEMPT Test fix Change-Id: I6535a023b66506e363d03b121abb60e6b08c5070
2025-02-27Merge "Add test for MessageBuilder" into main Treehugger Robot
2025-02-27Merge "Move the selection menu from the ActionBar to NavigationView" into main Ben Reich
2025-02-27Add test for MessageBuilder Ben Reich
This entire class isn't tested at all. Let's add a test that simply validates the correct plural strings were called. Bug: 395926758 Test: atest com.android.documentsui.ui.MessageBuilderTest Flag: EXEMPT Adding test coverage Change-Id: I64db6a077f58ac8b28ef30960ee6b62e71ca768a
2025-02-27Enable test to verify isRecursiveCopy of downloads and internal storage Ben Reich
This test has been disabled previously for being flaky locally. Unfortunately it provides coverage for a rather large and critical code block in the CopyJob. Let's enable it and watch the flakiness of it to make it more robust instead of just disabling it. Bug: 395926758 Flag: EXEMPT Test enablement Test: atest testRecursiveCopyDocuments_InternalStorageToDownloadsProvider Change-Id: I67cd6fa80afb02af795baedca82b515ab24f5371