summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Deal with slow permissionMgr dumpPhilip P. Moltmann2020-08-251-2/+13
| | | | | | | | | | | | Some devices, esp. virtual devices can take a long time to produce a permission mgr dump. This can be longer than the timeout and hence the test gets a null dump. In these cases, just skip the test. Fixes: 164441904 Test: atest PermissionControllerOutOfProcessTests Change-Id: I58247267de192f53d7182c9c435c8507015ab8c3
* Merge "Move OnGoingUsage dialog out of debug folder" into rvc-qpr-devTreeHugger Robot2020-08-173-3/+5
|\
| * Move OnGoingUsage dialog out of debug folderPhilip P. Moltmann2020-08-073-3/+5
| | | | | | | | | | | | Test: atest ReviewOngoingUsageFragmentTest Bug: 162547999 Change-Id: Ic564a552a88d355b6003f811e9f97da47a935c4e
* | Remove User Sensitive Assistant handlingNate Myren2020-08-124-296/+0
|/ | | | | | Test: Build and check flags of Google app Bug: 162547999 Change-Id: I2fac256f4939d53be01df1d150e06c524a3a8177
* Use SharedPreferences for assistant mic switch, move tests to inprocessNate Myren2020-08-064-0/+296
| | | | | | | | | | | | Use shared preferences instead of settings.secure for the "show assistant microphone usage" switch. Also moves the assistant user sensitive tests to be in-process. Fixes: 162901322 Test: atest AssistantRoleUserSensitiveTest, select the GooglePermissionController tests Change-Id: I9ce5c5a1938cf114254e660160d38bdbc541b5e7
* Add test for ReviewOngoingUsageFragmentPhilip P. Moltmann2020-07-301-0/+64
| | | | | | Bug: 161007415 Test: atest PermissionControllerInProcessTests Change-Id: I308b7fc53806096764fa8afc3193928f6c24eb17
* Add test for PermissionUsageFragment.Philip P. Moltmann2020-07-306-0/+251
| | | | | | Bug: 161007415 Test: atest PermissionControllerInProcessTests Change-Id: I89a7cc66d502d09324f8651924c829021e10f0cb
* Fix inprocess test helper apps.Philip P. Moltmann2020-07-309-0/+230
| | | | | | Bug: 161007415 Test: atest PermissionControllerInProcessTests Change-Id: I2c406aa6af3725bf76630160083f9c2323556d96
* Set content description on work profile app. am: c3e00f0f65Evan Severson2020-05-281-0/+1
|\ | | | | | | Change-Id: Ieac2da9c944d636b4bb0e466d5bf142a84215ae7
| * Set content description on work profile app.Evan Severson2020-05-271-0/+1
| | | | | | | | | | | | Test: Use talkback on PermissionAppsFragment Fixes: 127602715 Change-Id: I43736cf22183ca40bb763d47723fe43368f7bc3e
* | Merge changes Ifdd7ddcf,I1ad67f1d into rvc-dev am: e6f418e103Philip P. Moltmann2020-05-154-0/+167
|\| | | | | | | Change-Id: Ia0b9802b7834359cd9f40915ed326992b011182c
| * Merge changes Ifdd7ddcf,I1ad67f1d into rvc-devPhilip P. Moltmann2020-05-154-0/+167
| |\ | | | | | | | | | | | | | | | * changes: Add test for permission controller dump code Add state of auto-revoke toggle to dump
| | * Add test for permission controller dump codePhilip P. Moltmann2020-05-144-0/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Only test very basic stuff for now. Still this make sure that dumping in general works - This adds a new test suite for out of prcoess permission controller tests. This is for tests that are not CTS, need to interact with the system (i.e. not mocking) and should not run in the permission controller process. Fixed two issues: - Do not nest lifecycles in AutoRevokeStateLiveData - Do not re-register for package changed when live data is not active in LightPkgInfoLD and PermStateLD Test: atest PermissionControllerOutOfProcessTest Bug: 151252163 Fixes: 11484369 Change-Id: Ifdd7ddcfde0a03145663f88bb9c9c19dbf3da649
* | | Merge "Add work around for loading vector drawable." into rvc-dev am: 89ab481bc0TreeHugger Robot2020-05-133-3/+38
|\| | | | | | | | | | | Change-Id: I3a210920c7a4e3e0033982b3ad3a3a098a1de0a7
| * | Add work around for loading vector drawable.Hai Zhang2020-05-123-3/+38
| |/ | | | | | | | | | | | | | | | | | | The copy of AppCompat inside the test app is linked against the R class of the test app, and takes precedence when it instruments PermissionController. Fixes: 153792195 Test: atest Manage{Custom,Standard}PermissionsFragmentTest Change-Id: I1ebefe311951e10d2f874bbf087cc9ef45db0c89
* | Merge changes from topic "SplitPermissionControllerTests" into rvc-dev am: ↵TreeHugger Robot2020-05-051-2/+251
|\| | | | | | | | | | | 8864bd8ac4 Change-Id: I89c6b355877cccd3579c5fc824a25fc74496c59e
| * Test onUpgradeLockedDataLoadedPhilip P. Moltmann2020-05-041-2/+251
| | | | | | | | | | | | | | | | | | | | Found issues related to loading groups for expanding location and storage. Bug: 155019930 Test: atest RuntimePermissionsUpgradeControllerTest Change-Id: I6b95817052a1409f3cdd581897304c7fc13e4188 Merged-In: I6b95817052a1409f3cdd581897304c7fc13e4188
* | Keep record of restricted permissions in LightAppPermGroup am: 0aa049454cPhilip P. Moltmann2020-05-051-100/+134
|\| | | | | | | Change-Id: I604c329b92c81e48c9c6ba07046ee3a7350864ad
| * Keep record of restricted permissions in LightAppPermGroupPhilip P. Moltmann2020-05-041-100/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restricted non-whitelisted permission should indeed be treated as if not even requested. But there are very rare cases where they are still needed. This refactors the creation of the LightAppPermGroup a little as now the restriction computation happens in LightPermission. Hence LightPermission needs a package as an argument which changes GrantRevokeTests a little. Bug: 155019930 Test: atest GrantRevokeTests Change-Id: Id979f6165d09456948a3868bcf9ff058eeb9bd1b Merged-In: Id979f6165d09456948a3868bcf9ff058eeb9bd1b
* | Add tests for whitelisting of preinstalled packages on OTA. am: d78450245fPhilip P. Moltmann2020-05-052-0/+288
|\| | | | | | | Change-Id: I30d97770d2de35d50c0827fdbaa80d80fa813cc9
| * Add tests for whitelisting of preinstalled packages on OTA.Philip P. Moltmann2020-05-042-0/+288
| | | | | | | | | | | | | | | | | | | | | | As this test mocks out the environment it has to intercept quite a few calls. Unfortunately this test cannot be written as a black box test as it requires an OTA. Test: atest PermissionControllerMockingTests PermissionControllerInProcessTests Bug: 155019930 Change-Id: I8e90f69743871df69dfe1f1095feb9394e12f95e Merged-In: I8e90f69743871df69dfe1f1095feb9394e12f95e
| * Split permission controller unit testsPhilip P. Moltmann2020-05-04116-2031/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into: - Tests that drive the real permission controller from inside the process. - Tests that mock out dependencies and hence don't run inside the real app. This new test includes all the permission controller files locally, but of course is not integrated with the system and hence breaks when interacting with it. Therefore this test app should only be used for tests that cannot be written as blackbox or in-process tests. Bonus: - Delete unnecessary translations - Move ui.handheld tests into the right package Test: atest PermissionControllerMockingTests PermissionControllerInProcessTests Bug: 155019930 Change-Id: Id2d4d4a9c638a5c6a4febdf8f7a94636f757bdad Merged-In: Id2d4d4a9c638a5c6a4febdf8f7a94636f757bdad
| * Import translations. DO NOT MERGEBill Yi2020-05-041-4/+2
| | | | | | | | | | Auto-generated-cl: translation import Change-Id: I439266c31fd7838d191667ae3db2cc17dc132251
* | resolve merge conflicts of 06f626aa88dd7e89f4d340cea680ec2b63a59d2c to ↵Philip P. Moltmann2020-05-05125-2301/+176
| | | | | | | | | | | | | | | | rvc-d1-dev Bug: 155019930 Change-Id: I174a4fd8a395f93b519b38cd4fd2b4482acac05f Merged-In: Id2d4d4a9c638a5c6a4febdf8f7a94636f757bdad
* | Merge "Work around atest issue by moving tests into their own files." into ↵TreeHugger Robot2020-04-304-50/+111
|\| | | | | | | | | | | rvc-dev am: 57747f2842 Change-Id: I8d80e94471c717472a03707fdd8b9750d61610e7
| * Work around atest issue by moving tests into their own files.Hai Zhang2020-04-294-50/+111
| | | | | | | | | | | | | | | | Bug: 153792195 Test: atest CustomPermissionAppsFragmentTest Test: atest LocationPermissionAppsFragmentTest Test: atest StoragePermissionAppsFragmentTest Change-Id: I9d7e1bc50578188d8dae8f1b74e10d8d2e384efc
| * Merge "Import translations. DO NOT MERGE" into rvc-devTreeHugger Robot2020-04-2811-44/+22
|/|
| * Import translations. DO NOT MERGEBill Yi2020-04-2811-44/+22
| | | | | | | | | | Change-Id: I1afd2e12ded8e96f9dc4d91076b4c9338a1ff9af Auto-generated-cl: translation import
* | Use navController for back navigationPhilip P. Moltmann2020-04-272-2/+4
|/ | | | | | | Test: atest PermissionControllerHostTests Navigated through the UI Fixes: 154963521 Change-Id: I5e74f3c5445863ea7bcb56ee08582bcc4bf243ce
* Merge "Run PermissionAppsFragmentTest for storage and location too" into rvc-devTreeHugger Robot2020-04-274-33/+116
|\
| * Run PermissionAppsFragmentTest for storage and location tooPhilip P. Moltmann2020-04-244-33/+116
| | | | | | | | | | | | Test: atest PermissionControllerHostTests Bug: 153792195 Change-Id: Ib772d83eb8c4b315f66aa8bd8f74c1343a8ec843
* | Import translations. DO NOT MERGEBill Yi2020-04-2712-40/+70
|/ | | | | Auto-generated-cl: translation import Change-Id: I4b0a59222f798aeb7579f848b6a664fa4a7200de
* Import translations. DO NOT MERGEBill Yi2020-04-2383-1/+333
| | | | | Auto-generated-cl: translation import Change-Id: Id92fdd656c302ad93989482ed97fddc85fffa1c2
* Test PermissionAppsFragmentPhilip P. Moltmann2020-04-221-0/+116
| | | | | | Test: atest PermissionAppsFragmentTest Bug: 153792195 Change-Id: I6b7439a45b03aaaeddcb1ff50232a25525c253da
* Add test for ManageCustomPermissionsFragmentPhilip P. Moltmann2020-04-202-0/+218
| | | | | | | | | | | - Also some AppPermissionFragmentTests related to custom permissions Bonus: - Made custom permissions always user sensitive Bug: 153792195 Test: atest PermissionControllerUnitTests Change-Id: Id08994b2e4099c4e31dc8ba064cd2178c98d9564
* Write tests for AllAppPermissionsFragmentPhilip P. Moltmann2020-04-207-0/+199
| | | | | | | | | | | | | | | - Adding/removing permissions while fragment is visible - Close on app uninstall Bonus: - Factored out common methods into EspressoPreferenceUtils - Fixed two issues in AllAppPermissionsFragment - Fragment can now handle apps without platform runtime permissions - Fragment now closes when app is uninstalled Bug: 153792195 Test: atest AllAppPermissionsFragmentTest Change-Id: I70616c4e79fa1f0b440619c28da976ca613005f7
* Add ManageStandardPermissionsFragment unit tests for permissions disappearingPhilip P. Moltmann2020-04-201-1/+70
| | | | | | Bug: 153792195 Test: atest PermissionControllerUnitTests Change-Id: Icc55ee4b371bf727c28f154ea25dda5637f1a421
* Refactor permission controller ui unit testsPhilip P. Moltmann2020-04-208-117/+259
| | | | | | | | | - factor out useful methods into libraries - rename packages to not mix with cts Bug: 153792195 Test: atest PermissionControllerUnitTests Change-Id: Icc55ee4b371bf727c28f154ea25dda5637f1a422
* Import translations. DO NOT MERGEBill Yi2020-04-1977-0/+1617
| | | | | Auto-generated-cl: translation import Change-Id: Iadd4bafa96253a06751270ac3e0dd8634e3c89ed
* Test ManageStandardPermissionsFragmentPhilip P. Moltmann2020-04-137-0/+401
| | | | | | | | | | - when installing app - when granting permission - when installing app defining (and using) an additional permission Test: atest ManageStandardPermissionsFragmentTest Bug: 153792195 Change-Id: Ia751f61cccaae2492da555490970be0838d95e3b
* Fix GrantRevokeTestsPhilip P. Moltmann2020-04-131-1/+10
| | | | | | | | The lib now seems to always update all flags. Fixes: 153792195 Test: atest GooglePermissionControllerUnitTests Change-Id: I887152cbaf4c574798114b645deec74fe6ca6f22
* Clean up PC unit testsPhilip P. Moltmann2020-04-136-68/+65
| | | | | | | | | | | | - Move tests to same java-package as tested files so that package private methods can be used - Convert all tests to Kotlin - Move to undeprecated test-infra - Clean out unnecessary dependencies out of built file Bug: 153792195 Test: atest --include-subdirs --test-mapping packages/apps/PermissionController Change-Id: I7cd6d6437f6492c44d5c7eaf14f57534c46c487c
* Limit last used time by installTimeEugene Susla2020-03-301-1/+1
| | | | | | Fixes: 152529922 Test: manual Change-Id: Ic954270a46595f0887a7a5965033d07445c49be0
* Update USER_SENSITIVE flags on app install and optimize itEugene Susla2020-03-121-1/+1
| | | | | | | | | | | | | | This also parallelizes flag updating Bug: 141311767 Test: - on first boot go to permissions screen, and ensure system apps categorization makes sense - install app that requests location, and ensure it's not listed as system app in permission screen Note: listener in PermissionPolicyService is currently disabled Change-Id: I33977b70af0733852dc23e76c2b1bc4130825606
* Fix wrong permission state on deny-anywayEvan Severson2020-03-031-13/+12
| | | | | | | | | | | This change fixes the behavior where denying a permission in AppPermissionFragment which prompts the deny-anyway dialog will always force it to select "deny" even if the denial was by selecting "ask every time". Fixes: 150400424 Test: Manual + atest PermissionsHostTest Change-Id: Ie54f911eff925f9b667cfd65ee2fa5dda26e16b4
* Add Grant/Revoke testsNate Myren2020-01-314-3/+1062
| | | | | | | | | Add tests for the KotlinUtils grant/revoke methods Test: atest GrantRevokeTests, or m GooglePermissionControllerUnitTests && adb install ~/InternalMaster/out/target/product/blueline/testcases/GooglePermissionControllerUnitTests/arm64/GooglePermissionControllerUnitTests.apk && adb shell am instrument -w com.google.android.permissioncontroller.tests.unit && adb uninstall com.google.android.permissioncontroller.tests.unit Change-Id: Ic421027f911a2a166a42dd64d06db0c86e268e9a
* Add unit test for parsing and validating roles.Hai Zhang2020-01-131-0/+39
| | | | | | | | | | | | Also split RoleParser from Roles so that we can enable validation, and fixed app op validation to only throw when app op has an associated runtime permission (instead of any permission). Bug: 147606788 Test: m GooglePermissionControllerUnitTests && adb install out/target/product/blueline/testcases/GooglePermissionControllerUnitTests/arm64/GooglePermissionControllerUnitTests.apk && atest GooglePermissionControllerUnitTests Change-Id: I12a3840e459ed40b5be8a556cfa8a8e336fa5c12
* Add unit tests for PermissionController.Hai Zhang2019-12-164-0/+124
| | | | | Test: atest GooglePermissionControllerUnitTests Change-Id: I7be291b2b30df4a0800d8603dbe97cdc34c36755
* Use multi-field logs to log permissionsPhilip P. Moltmann2017-11-025-342/+0
| | | | | | | | | | | | | | | | | Before this change each permission+action combo had it's own ID. This was very fragile and did not work for non-system permissions. Now the action is the log-type and the permission is just a field in the log. Removed EventLogger test as all this test was supposed to do was prevent issues with permission-action not having the proper IDs. This obviously did not help. Test: Used API 23 and API 26 apps to grant and revoke permission and confirmed logs are as expected Change-Id: Id35e3250fcf875bde34953aa57c95ccd0880548a
* Remove dependency on platform-system-robolectricMaurice Lam2017-09-061-4/+0
| | | | | | | | | | | Dependency on platform-system-robolectric is not needed when mockito is not necessary. If mockito is needed, add a static dependency on mockito-robolectric-prebuilt. Test: cd tests/robotests && mma Bug: 38456058 Change-Id: I0bcb5f0a3656b3534b47d046eb13f41502661fad