Commit Graph

40 Commits

Author SHA1 Message Date
Christophe Pinelli
9d46bca1b9 Make mutable PendingIntent explicit
Starting from target SDK U, we will block creation of mutable
PendingIntents with implicit Intents because attackers can mutate the
Intent object within and launch altered behavior on behalf of victim
apps. For more details on the vulnerability, see go/pendingintent-rca.

From a quick analysis, we concluded that the PendingIntent here was only
destined to the test app/to the app, so it was made explicit. Reviewers,
please call out if this is not the case.

Bug: 236704164
Test: atest NexusLauncherTests:com.android.quickstep.DigitalWellBeingToastTest
Test: atest RequestPinItemTest
Change-Id: I81311b0588b7b712c97de6cb016a62bb91c7a77c
2023-01-12 01:51:44 +00:00
Sunny Goyal
cd2ac0f3e9 Updating target SDK for Launcher
Bug: 229173942
Bug: 226461147
Test: Presubmit
Change-Id: Id9e303f113cba87adf26442f1417ed2814555c54
2022-04-18 13:55:01 -07:00
vadimt
41c0b52cd9 Renaming LauncherInstrumentation.pressHome to goHome
This is a better name now that we have gestural nav.

Renaming will happen in stages, the first one being having 2 names side-by-side.

Test: presubmit
Bug: 187761685
Change-Id: Ifb15c838cc0e161d852cf6df025687e3f92d6124
2022-03-14 18:13:47 +00:00
Alex Chau
0a1f7d5de5 Add ScreenRecord for a flaky test
Bug: 215673732
Test: none
Change-Id: I175031be50e37f7c14643475e3b44bfc514022e4
2022-01-24 18:56:40 +00:00
Alex Chau
9b3dd6c0b9 Revert "Clear only workspace shortcut / widget related tests"
This reverts commit 22be1a47f4.

Reason for revert: Breaks another test
Bug: 202546679

Change-Id: I796c508a6d7c00ec8c1d48e3517453f9eca0616c
2021-10-18 17:52:12 +00:00
Alex Chau
22be1a47f4 Clear only workspace shortcut / widget related tests
- This ensure hotseat to be populated with default items, so it won't result in an empty taskbar which get stashed in apps
- Workspace needs to be cleared because shortcut / widget dragging won't always work if there are items in workspace. It only happens in test due to the way we drag items.

Fix: 202546679
Test: NexusLauncherTests:com.android.launcher3.ui.widget.RequestPinItemTest
Change-Id: Ib3ded6a685eaa1b169b75fd179c9e29ca4be1e72
2021-10-15 16:01:44 +01:00
Sunny Goyal
1aff018e17 Cleaning up fixed bug
Bug: 192010616
Test: Presubmit
Change-Id: I12d79726852a588cb0ee6b1aaf5ab8bccb9c3cfc
2021-09-07 12:04:44 -04:00
Alex Chau
27ee6447db Clean up screen record for tests
- Add new record and remove obsolete ones

Bug: 193440212
Bug: 193125090
Bug: 192005114
Test: manual
Change-Id: I860c42961e710e1542d9d911338dd359896b6970
2021-07-29 11:01:09 +01:00
Sunny Goyal
711c596c86 Binding Taskbar directly from Launcher model
This allows taskbar to be loaded even in case of 3P Launchers
and removes dependency on LauncherActivity lifecycle

Bug: 187353581
Bug: 188788621
Test: Manual
Change-Id: I5a0988e0697b41677d4c58f0213aef14ec0c0972
2021-07-15 12:43:11 -07:00
Sunny Goyal
85a84e52cc Enabling screen record for some flaky tests
Bug: 187080582
Bug: 192005114
Bug: 192018189
Bug: 192010616
Test: Manual
Change-Id: I32fc0e4c9848c4def1aa6254139579bc631862cc
2021-06-25 15:40:55 -07:00
Sunny Goyal
eaf7a95546 Changing minimum supported Launcher version to 26
Change-Id: I49fcf874430ac53c3246371e179fbd828e14e4da
2020-07-29 17:30:19 -07:00
Sunny Goyal
e396abf502 Moving model data structures to a separate file
Change-Id: I77ad7a5219e72d2e0d6c1803de2ac3ed6a65a8f7
2020-04-09 13:20:39 -07:00
Sunny Goyal
fc86a9c75c Removing unnecessary method from tests
Change-Id: I28b180b0e63b277b1bf2b206a848fc6ff14a2722
2020-01-28 10:45:48 -08:00
vadimt
2eb48498b4 Improving navigation mode switch rule and around
Logging assertion failures.
Modifying waits for condition to avoid timing out the whole test if the
iteration takes too long in favor of failing with an actionable diag.

Bug: 145985438
Change-Id: Ie32d93e1548ce6ec64c38449eb1be1287ff9cf56
2019-12-12 15:10:52 -08:00
vadimt
137f5b62ac Improve diags when system errors cause failing Launcher tests
Now, for example, we won't diagnose a locked phone as a
"home button not showing in 3-button mode", even though it's technically
correct.

Change-Id: Ibdfa0741af7ff8545a811f6702dda74dc6c31c2e
2019-11-04 14:50:22 -08:00
vadimt
8c2efd0de0 Enabling some tests in landscape mode
Bug: 121280703
Change-Id: I285638d832594d5fed26ee812737a4356b110899
2019-09-04 17:33:52 -07:00
vadimt
d91cec72fe Simplifying switching to home for some tests
Change-Id: I696d0267a2c36a18080396657bed07f7b1654a7d
2019-07-12 12:26:08 -07:00
vadimt
2d4b05f295 Converting more tests to TAPL
Bug: 131116002
Bug: 115582915
Change-Id: I3346f96ddba3224eb4b92b15344d71b8ed6e32e0
2019-06-26 11:23:23 -07:00
vadimt
3a6eedc61b Converting some widget tests to TAPL
Bug: 115582915
Change-Id: I07c6ca5ef712cf1a85d81e7d4b4bda3604777ac8
2019-06-25 18:34:48 -07:00
vadimt
6346451bd6 Tests: fixing expected package name for AOSP tests
Change-Id: Id7a57d4bfcbed23ba20ca11846680fa1341e8a99
2019-06-21 10:58:03 -07:00
vadimt
d11b604e19 Converting some tests to TAPL
Change-Id: I1b67f80d9d61792d5795f9638bf9d19919f36d39
2019-06-20 17:53:05 -07:00
vadimt
06d30e54d5 Enabling tests in landscape mode
Bug: 121280703
Change-Id: I3245ca8d0b0496035658ce2a602882a62942f3f1
2019-06-17 15:13:25 -07:00
vadimt
c7bb8479e9 Fix pinning tests on android virtual device
Change-Id: I90a8753975538ab9864591a37a7d366e1222f2d8
2019-05-16 16:32:25 -07:00
vadimt
1bdb0f4046 Enable BindWidgetTest, RequestPinItemTest
Comparing only widget provider class names, as package names (sometimes)
switch to the test package, not to the ones in Launcher.

Bug: 131116593
Change-Id: Ieeed69432303a86fcefb194d509cdaf9d4513f3a
2019-05-03 13:49:52 -07:00
vadimt
677abe2117 Annotating ignored tests with requests to enable them
Bug: 117106893
Change-Id: Ib8e578913ceebee44a507b5e333e7da07c6120d0
2019-04-22 17:34:29 -07:00
Sunny Goyal
9589916418 ShortcutInfo renamed to WorkspaceItemInfo
Will get rid of ShortcutInfoCompat in a follow up cl

Change-Id: I7d7d9c938635f59b216290ba28bea9d0e0721a7d
2019-04-16 00:08:24 -07:00
Vadim Tryshev
34b6f9f106 Supporting OOP tests
AbstractLauncherUiTest was modified to compile and work both in- and
out- of proc.

Bug: 113056917
Test: was in Nexus branch
2018-10-13 01:13:45 +00:00
Sunny Goyal
4470344529 Fixing BindWidgetTest failing on Launcher3
Bug: 117616326
Change-Id: I3d08defc735498305cf982b214f6c0fae1508bd9
2018-10-11 16:06:52 -07:00
Vadim Tryshev
14c6c8cee4 Improving tests to fix testBindNormalWidget_withoutConfig, and beyond
1. Make waitXXX methods fail if the condition diesn’t turn true.
2. Waiting for loading to complete in tearDown instead of reloading the
 model
3. Avoiding waiting for load-complete where loading didn’t start
4. Disabling last test in AddConfigWidgetTest
5. Waiting for loading to complete inside setupAndVerifyContents(), not
 outside
6. Unifying how we wait for loader to complete
7. Adding more logging

Bug: 117332845
Test: running all Nexus tests
Change-Id: I3070e1ac2b9161179cc3e0800b0cd8162807389a
2018-10-09 18:47:42 -07:00
Sunny Goyal
4ed58d6c03 Adding tests for fallback recents when a 3rd party launcher is installed
Change-Id: I1d4da13cc779f49832008b12b9628d01631faffe
2018-10-09 14:25:01 -07:00
Vadim Tryshev
0a9f3ab4a6 Converting tests to Androidx
Bug: 112610679
Change-Id: I712826e668f1fbeb4e47cc541d4f5296d8eb74c0
2018-08-21 15:04:48 -04:00
TreeHugger Robot
a950d40d09 Merge "Started converting Launcher to be gesture-stable" into ub-launcher3-master 2018-08-14 19:18:46 +00:00
Vadim Tryshev
dc755e718d Started converting Launcher to be gesture-stable
All tests keep passing.

WorkTabTest.workTabExists was made gesture-stable. There is no need to
use TAPL, as the point is not to check answering to gestures, but to
check presence of tabs, which is better to do using launcher internal
state. (It still fails if run as a part of all tests, presumably,
because after Launcher's start, changes in user configuration are not
recognized, so I've commented the failing part)

Bug: 110103162
Test: Run all tests
Change-Id: Ic30b8e8475d16cee3880332f12311a44ddfa26cb
2018-08-14 10:29:57 -07:00
Sunny Goyal
6edb1b84bf Changing Condition to an interface to allow using lambdas
Change-Id: Ib7ad6a45d2ce556f843cd3a9767001904707dced
2018-08-14 10:27:48 -07:00
Jon Miranda
ca02f00eb1 Add @Test and @Ignore to untested test methods in RequestPinItemTest.
Error prone complains when trying to merge launcher3 code to platform pi-dev.

"This looks like a test method but is not run; please add @Test and @Ignore,
or, if this is a helper method, reduce its visibility."

Output:

Executing tasks: [:assembleGoogleDebug, :assembleGoogleDebugAndroidTest]
Gradle build finished in 1s 631ms
Tests Ignored: 1 passed, 4 ignored

Bug: 78589564
Change-Id: Icde57fd8307e1ef409822d1417f629cd1aaa57ba
2018-06-21 17:20:23 -07:00
Hyunyoung Song
3efd037e63 Fix the Launcher3Tests
Bug: 78589564

$ adb shell am instrument -w com.android.launcher3.tests/android.support.test.runner.AndroidJUnitRunner

com.android.launcher3.allapps.search.DefaultAppSearchAlgorithmTest:..
com.android.launcher3.logging.FileLogTest:..
com.android.launcher3.model.AddWorkspaceItemsTaskTest:....
com.android.launcher3.model.CacheDataUpdatedTaskTest:...
com.android.launcher3.model.DbDowngradeHelperTest:....
com.android.launcher3.model.GridSizeMigrationTaskTest:...........
com.android.launcher3.model.LoaderCursorTest:........
com.android.launcher3.model.PackageInstallStateChangedTaskTest:...
com.android.launcher3.popup.PopupPopulatorTest:..
com.android.launcher3.provider.RestoreDbTaskTest:..
com.android.launcher3.touch.SwipeDetectorTest:.....
com.android.launcher3.ui.AllAppsAppLaunchTest:..
com.android.launcher3.ui.AllAppsIconToHomeTest:..
com.android.launcher3.ui.ShortcutsLaunchTest:..
com.android.launcher3.ui.ShortcutsToHomeTest:..
com.android.launcher3.ui.WorkTabTest:.
com.android.launcher3.ui.widget.AddConfigWidgetTest:....
com.android.launcher3.ui.widget.AddWidgetTest:..
com.android.launcher3.ui.widget.BindWidgetTest:......
com.android.launcher3.ui.widget.RequestPinItemTest:.
com.android.launcher3.util.GridOccupancyTest:..
com.android.launcher3.widget.WidgetsListAdapterTest:......

Time: 180.363
OK (76 test)

Change-Id: I4a50581bc8d06a030467ac9fec3e1ef668745214
2018-06-19 14:13:13 -07:00
Hyunyoung Song
e24cb63b81 WallpaperManagerCompat should target correct platform
Also replace Utilities.isAtLeastO() to static final constant.
Bug: 65544683

Change-Id: I39fbea66939d72c31702748716c4e65b4f9bee6a
2017-09-11 12:17:09 -07:00
Sunny Goyal
1d7f45d8f8 Fixing various tests
> Migrating UI tests to AndroidJUnit4 for better support
> Removing obsolete RotationPreference test
> Fixing broken FileLogTest and AndroidJUnit4
> Removing InvariantDeviceProfileTest as it does not work well with
  resource overlays

Change-Id: I0abb1df6765d76d86c1c6c84e8ac35eb9a6bcdaa
2017-07-31 11:03:54 -07:00
Sunny Goyal
c65a0085d7 Adding support for showing the widget preview based on the provided RemoteViews
Bug: 35811129
Change-Id: I336e48cd00cfec2e617ac73bd8a81419b0944aa7
2017-03-17 11:25:29 -07:00
Sunny Goyal
d9843357d0 Adding some tests for request pin shortcut/widget flow
Bug: 33584624
Change-Id: I49df36f60d2ae071b9d2c77c9c3300e010cd3bb9
2017-02-22 15:46:40 -08:00