Commit Graph

33 Commits

Author SHA1 Message Date
Torne (Richard Coles)
c82baecc32 Update use of android.webkit.UserPackage.
UserPackage no longer stores a UserInfo, only a UserHandle, to aid in
mainline modularization. Update Settings to fetch the UserInfo itself
when it needs to show the user name.

Bug: 310653407
Test: atest WebViewAppPickerTest
Flag: NONE cannot flag changed types in method signatures
Change-Id: I0e6f58e6b6a353171ddf923279ff08a92e2f040a
2024-09-09 18:00:59 -04:00
Yanting Yang
5bca487a8c Ignore failing test of WebViewAppPickerTest
Bug: 313615637
Test: atest
Change-Id: Ic63c31b5220ab9b2cba11c11f4b40cf35ea6f3f9
2023-11-28 21:02:08 +08:00
Edgar Wang
292f407071 Fix robo test case failed
Bug: 300134365
Test: robotest
Change-Id: I144fbbc962a479c97312cee1645c5a3d70351542
2023-09-26 15:49:40 +08:00
Rex Hoffman
3c961e1c0e Setup external/robolectric for SettingsRoboTests
Current failing tests: ab/I64100010182936387
Had to Ignore some of com.android.settings.accessibility tests, which will be fixed separately

Bug: 261728063
Test: atest SettingsRoboTests -- --test-arg com.android.tradefed.testtype.IsolatedHostTest:java-flags:-XX:CompressedClassSpaceSize=3g

Change-Id: I4a0cb992db924936826e0c9808accc78dddb5f30
2023-08-17 22:33:20 +00:00
Yuri Lin
e9f13fbd5e Rename RadioButtonPreference -> SelectorWithWidgetPreference.
This change is to reduce ambiguity as we're adding the option to style the preference like a checkbox as well.

Bug: 190180868
Test: SelectorWithWidgetPreferenceTest, RunSettingsLibRoboTests
Change-Id: Ie414347bf67ed394ef495604890c5851fc42dbc7
2021-07-20 17:01:21 -04:00
Jeff Sharkey
1a703c4846 Revert "Ignore a lot of failed test cases on Settings"
This reverts commit d9d08ebd4f.

Bug: 154727109
Test: make RunSettingsRoboTests
Exempt-From-Owner-Approval: re-enabling tests
Change-Id: I4ed490f0199683ee84d687be17f7e90091deb7f1
2020-04-22 18:08:41 +00:00
Sunny Shao
d9d08ebd4f Ignore a lot of failed test cases on Settings
Bug: 154667181
Bug: 154667917
Bug: 154667745
Bug: 154668517
Bug: 154667730
Bug: 154668805
Bug: 154669079
Bug: 154668589
Bug: 154670012
Bug: 154669528
Bug: 154668369
Bug: 154670613
Bug: 154669869

Test: make RunSettingsRoboTests
Change-Id: I37bf61fcd965b821e0198c695720ff826c8417b9
2020-04-22 12:51:30 +08:00
Raff Tsai
71a37d138b Import RadioButtonPreference from SettingsLib
Bug: 138620011
Test: manual, robolectric
Change-Id: I3b8a2be021a1b4a07aae61483f2329b7a5bd4655
2019-08-01 07:16:55 +00:00
tmfang
b031388999 Fix WebViewAppPickerTest
- Also do some minor refactoring

Test: robotest
Fixes: 131921277
Change-Id: I8de2e1b9b384ef9722bbe95111b86193fddb83d5
2019-05-06 15:25:53 +08:00
Andrew Sapperstein
7af5a9e0c3 Mark broken tests @Ignore.
Bug: 131921277
Test: robotests
Change-Id: I2dc1a4ecc41e07284710fbffc2a980aee805e745
2019-05-03 14:43:47 -07:00
James Lemieux
db06e1f9b8 Fix test cases for impending Robolectric merge
Bug: 121048884
Test: make -j56 RunSettingsRoboTests
Change-Id: I13568f48b66c79ff6f7806d8bc2c54ba05e7f595
2018-12-21 14:20:11 -08:00
James Lemieux
f1dade40d2 Use binary resource support in robolectric
The resources available to tests are now exactly the merged resources
located in the APK under test.

Bug: 74359828
Test: make -j56 RunSettingsRoboTests
Change-Id: I050db81a92decefea23314b5ec7a62f77ff4bb2b
2018-12-12 19:53:49 -08:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
tmfang
f12e6adcdc Settings Fragment Migration (Fix test cases)
Fix all Roboletric test cases.
In this CL, some test cases are broken.
So, We ignored these test cases temporarily.

Test: make RunSettingsRoboTests -j56
Bug: 110259478
Change-Id: I1a3075438a614432a2de4f2d96d8abf9a83ce58c
2018-07-11 18:24:51 -07:00
HJ ChangLiao
5693be2863 Replace PackageManagerWrapper with PackageManager
Replace all SettingsLib/PackageManagerWrapper in Settings,
by PackageManager,
Remove ShadowPackageManagerWrapper.

Bug: 62067063
Test: make RunSettingsRoboTests
Change-Id: I6d1af55c13d80c1907b98b21e0207cc903cd9b1f
2018-04-24 15:12:31 +08:00
Fan Zhang
5f9a348f7e Get rid of UserPackageWrapper util.
Robolectric can support framework private classes now, so there is no
need to use wrappers.

Bug: 76167422
Test: robotests
Change-Id: I034a9f0a9856348bff491f2e9b2b1f7d682ab942
2018-03-22 15:28:46 -07:00
James Lemieux
22a39c2b93 Use external/robolectric-shadows/run_robotests.mk
This allows Settings to test against the latest framework changes.

Also replaced TestConfig with traditional robolectric.properties.

Bug: 73173204
Bug: 73892008
Test: make -j56 RunSettingsRoboTests
Change-Id: I3135b4fa5f095ba79b282a76f45dd9baa2584bc7
2018-03-04 03:50:08 -08:00
Dake Gu
fef14cac00 Settings: Move DefaultAppInfo CandidateInfo to SettingsLib
Bug: 3600711
Test: Moved DefaultAppInfoTest to SettingsLib
      m RunSettingsRoboTests
Change-Id: If9e2288009277f1940b9769790b78bb0a58b626a
2018-02-23 13:23:16 -08:00
Leif Hendrik Wilden
28dee1f086 Migrate to use instrumentation classes from settingslib.
Test: Compiles. Manually tested.
Change-Id: I70a6e76cc8440547746ecc008c32bd06a7de8161
2018-01-24 12:30:39 -08:00
Leif Wilden
cab0ee611d Revert "Migrate to use instrumentation classes from settingslib."
This reverts commit 1546cca529.

Reason for revert: Broke fingerprint setup flow. b/72267201

Change-Id: I8321265ae64732c526325882ddea51080decddf5
2018-01-22 20:57:36 +00:00
Leif Hendrik Wilden
1546cca529 Migrate to use instrumentation classes from settingslib.
Test: Compiles. Manually tested.
Change-Id: Ie5515bb0fe3e621fc7723a9b04ba23e4bfa9c401
2018-01-18 11:13:24 -08:00
jeffreyhuang
cbfb099a40 Rename SDK_VERSION_O to SDK_VERSION
Test: make RunSettingsRoboTests -j40
Change-Id: I6715062d8addadda441e32809db1af55f15e3a90
2017-12-05 16:43:54 -08:00
jeffreyhuang
8db0979651 Update WebViewAppPickerTest to sdk 26
Test: make RunSettingsRoboTests -j40
Change-Id: I78bc9c11f713343eb2565f34a8137c3575e741d9
2017-12-01 15:50:57 -08:00
Fan Zhang
efa763624a Use IconDrawableFactory to load icons for default apps.
Bug: 64336923
Test: robotests
Change-Id: I2a4ca05a866784f97e247bad1c1679a6ec0f5efa
2017-10-17 15:56:16 -07:00
Maurice Lam
e18902ec67 Update Robolectric to 3.4.2
Bug: 66693279
Test: m RunSettingsRoboTests
      m RunSettingsRoboTests-jacoco
Change-Id: I9df619c3d68f0af2ee2ae944a15998275129f7c2
2017-09-22 18:34:00 +00:00
Doris Ling
dee1a22c45 Consolidate all wrappers used for testing.
- Add the wrapper package and move all wrappers to the wrapper package.
- Get rid of some wrapper interface/impl implementation and have a
wrapper class directly.

Bug: 65634579
Test: make RunSettingsRoboTests
Change-Id: Ic757d8f7bacfa7a034c7e692205bc1dc4b0e1de1
2017-09-14 18:24:49 -07:00
Andrew Sapperstein
9f1e911759 Refactor test runner to use static list of resource paths
Previously everything lived in an inner class method of
SettingsRobolectricTestRunner. That method has now been turned into
a static method so that it can be called by other runners.

Bug: 62460102
Test: robotests
Change-Id: I6612b1f26404587301c534c8ba60e39d59d6c840
2017-06-09 09:21:26 -07:00
Fan Zhang
012028e3a3 Misc logging changes
- log search result count, rank when clicking search result.
- log app package when default app is changed

Change-Id: Idd11bd67caba2beaa59c65839c40db8c71787388
Fix: 62072727
Test: make RunSettingsRoboTests
2017-05-26 12:28:13 -07:00
Fan Zhang
a278962dbc Refactor DefaultAppPicker to a general radio button picker
Bug: 36557316
Test: make RunSettingsRoboTests
Change-Id: I52985e527e55697cf29f8d97d775d4bbed025beb
2017-03-23 12:41:31 -07:00
Gustav Sennton
75f0b1b2e4 WebView implementation Dev setting: Show the version number after name
Show the package version of each WebView implementation after their
package name in the WebView Implementation Dev Setting. Showing a
package version is useful for debugging purposes.

Bug: 35621558
Test: run make RunSettingsRoboTests
Test: Ensure package version is shown in titles of items in WebView
Implementation Dev Setting.
Change-Id: If195dd87aebeac1783600b7c9f376ff8e791c3be
2017-03-10 14:40:37 +00:00
Gustav Sennton
3c89d8e2cf Fix disabled WebView packages being shown as enabled in Dev Setting.
WebView packages that cannot be chosen as WebView implementation should
be shown as disabled in the 'WebView Implementation' Dev Setting.
Simplify the logic in DefaultAppInfo a little bit to avoid
special-casing for the WebView Dev setting.
Also add tests to ensure we are correctly disabling WebView packages in
the Dev setting and showing their disabled-reasons.

Bug: 35707106
Test: 'make RunSettingsRoboTests'
Test: Ensure disabled WebView packages show up as being disabled in the
'WebView Implementation' Dev Setting.
Change-Id: Ic2f5265c3451b6396e55b7bc29689c3d889ddb5e
2017-03-07 19:30:10 +00:00
Gustav Sennton
5b596285a0 Have WebView Implementation Dev Setting use DefaultAppPickerFragment.
Make the WebView Implementation Dev Setting look like the fullscreen
settings deriving from DefaultAppPickerFragment.
Point the Activity opened through Settings.ACTION_WEBVIEW_SETTINGS to
the class WebViewAppPicker which is our new implementation of the
WebView Implementation setting.

Ensure the new setting closes if it is reached from a user that isn't an
admin of the device.

Bug: 34806477
Bug: 34966439
Test: Ensure WebView implementation Dev Setting looks ok (disabled
packages should have a text showing why they cannot be chosen).
Test: Start Intent with action Settings.ACTION_WEBVIEW_SETTINGS and
ensure the started Activity looks similar to the WebView Implementation
Dev Setting.
Test: Ensure picking a package that is no longer active, updates the
setting (so that package isn't visible anymore).
Change-Id: I08007c515193739ad61dfd735bb5130fc07bd6e6
2017-02-09 10:17:17 +00:00
Gustav Sennton
4d3334c50b Update WebView implementation Dev Setting - new looks + descriptions.
Now that we are changing the WebView package mechanism so that a package
can only be used as WebView implementation if that package is enabled
for all users of the device we need to tell the user why a package can't
be chosen as WebView implementation.
With this CL we do so in the 'Set WebView Implementation' Developer
Setting.

We code for the WebView implementation Developer Setting is now based on
the same code as that of the Debug App Developer Setting.

Bug: 32894154
Test: Ensure WebView Implementation setting shows correct packages.
Test: Ensure WebView Implementation setting shows correct descriptions
for why a package is not usable - including the case where packages are
disabled/uninstalled for a second user.
Test: Ensure the summary for the WebView Implmentation setting is
updated after changing WebView package.
Test: Ensure the WebView package Activity
(Settings.ACTION_WEBVIEW_SETTINGS) is similar to the Dev Setting.
Test: ensure non-admin user cannot start WV-picker activity through
'adb shell am start -n com.android.settings/.WebViewImplementation'

Change-Id: Ia6e6e9e12ce8f8f45ec539807cd0c6479acb8ecb
2017-01-23 18:34:11 +00:00