Commit Graph

209 Commits

Author SHA1 Message Date
vadimt
ee77946a7f Insert a check that keyguard is invisible into waitForLauncherCondition
This will unify diagnostics because otherwise waitForLauncherCondition would fail with a different message if keyguard is present.

Test: presubmit
Bug: 187761685
Flag: N/A
Change-Id: I1a34b4c2ad859b87263733a8a65527b8357e1950
2023-05-25 17:44:34 -07:00
Stefan Andonian
fa8091661a Added ViewCapture to all tests which implement AbstractLauncherUiTest.
This enables developers to watch failed tests in classes like
TaplTestsQuickstep in the go/web-hv tool.

Bug: 242867462
Test: Failed a test and verified that the TimeLapse bugreport entry
showed up properly in the go/web-hv tool.

Change-Id: Ic89af2a0e7102db52c52ddc668607a81c4809ed6
2023-05-12 21:15:14 +00:00
vadimt
2e1d2c32ed Making it clear that a test sees the keyguard for the first time.
This help to find a test which bugreport may still contain a recent crash in SysUI. This is the tests that prints "for the first time = true"

Test: presubmit
Bug: 187761685
Change-Id: Ic24a1d6f4ba36e117df2166c57bbc0a1d021cc7d
2023-04-20 14:14:23 -07:00
vadimt
160c8217d5 Failing all e2e tests after seeing a lock screen without additional checks for the lock screen
This will speed up the tests.

Test: presubmit
Bug: 276755129
Change-Id: I7170ea76d3e013a8b55187432809815c3713e6c7
2023-04-06 15:52:53 -07:00
Sunny Goyal
a1692a467f Moving all intent receiver register calls to a single place
This is eventually allow us to move all register to background thread
Also creating a single ScreenOn tracked which is used at multiple places

Bug: 264465756
Test: Verified on device
Change-Id: Ibadf9ca43218e578954420d97a733adfa0a94fc7
2023-01-20 23:50:00 +00:00
Sebastián Franco
a1707e3007 Merge "Remove unused Throw Throwable from clearHomescreen method" into tm-qpr-dev am: 48651b2109 am: c18a4081d5
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20831584

Change-Id: Ie10f728d6e544214f2ac91a209fd500635030a5a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-18 02:29:42 +00:00
Sebastian Franco
9db35f7a37 Remove unused Throw Throwable from clearHomescreen method
Test: presubmit
Bug: 263802298
Change-Id: I4b81e044eb4f6a84730fb4d61403cbfcadefd282
2023-01-12 10:41:34 -06:00
TreeHugger Robot
66f4641846 Merge "Add unaudited exported flag to exposed runtime receivers" 2022-11-04 13:03:45 +00:00
Sunny Goyal
f34811d3a3 Revert "Revert "Updating the scroll calculation from recyclerView to avoid view inflation""
Test: ABTD
https://android-build.googleplex.com/builds/abtd/run/L52600000956969786

This reverts commit cee6ddf3de.

Reason for revert: Fixed in ag/20239136

Change-Id: I0e8446e66d9a86a94b40fcbd6de14da07abe8e5c
2022-10-22 15:37:47 +00:00
Hui Kang
2a28ae8a3f Merge "Revert "Updating the scroll calculation from recyclerView to avoid view inflation"" into tm-qpr-dev 2022-10-17 21:20:09 +00:00
Hui Kang
cee6ddf3de Revert "Updating the scroll calculation from recyclerView to avoid view inflation"
This reverts commit 20bbe95ddb.

Reason for revert: Causing flake in Ironwood test: b/248295569

Test: ABTD
Before: Flaky, 14/50 PASSED
https://android-build.googleplex.com/builds/abtd/run/L33900000956890639

Revert: 50/50 PASSED
https://android-build.googleplex.com/builds/abtd/run/L49200000956887317

Change-Id: I41f4428c74e581323f90c716a7852b5e553ae27d
2022-10-17 20:37:49 +00:00
Ming-Shin Lu
4d4f62ac77 TAPL: add setIgnoreTaskbarVisibility in LauncherInstrumentation
As now FlickerTests is leveraging TAPL to interact devices CUJs,
we realized in LauncherInstrumentation will verify task bar visibility
automatically to expect it always visible when quick-switch, which is
not always reliable since the task bar may be hidden by manual or
when the activity requests to show IME.

Add setIgnoreTaskbarVisibility in LauncherInstrumentation for the caller
to ignore taskbar visibility if the test does not need to verify it.

Bug: 228012334
Bug: 240306344
Test: atest FlickerTests:SwitchImeWindowsFromGestureNavTest
      in tablet device
Test: atest NexusLauncherOutOfProcTests:com.android.quickstep.\
       TaplTestsQuickstep#testQuickSwitchToPreviousAppForTablet

Change-Id: Id0a35561523d733b8434acb702ec7dcaa466a1c2
2022-10-05 11:37:37 +08:00
Michael Groover
5e0eecc064 Add unaudited exported flag to exposed runtime receivers
Android T allows apps to declare a runtime receiver as not exported
by invoking registerReceiver with a new RECEIVER_NOT_EXPORTED flag;
receivers registered with this flag will only receive broadcasts from
the platform and the app itself. However to ensure developers can
properly protect their receivers, all apps targeting U or later
registering a receiver for non-system broadcasts must specify either
the exported or not exported flag when invoking #registerReceiver;
if one of these flags is not provided, the platform will throw a
SecurityException. This commit updates all the exposed receivers
with a new RECEIVER_EXPORTED_UNAUDITED flag to maintain the existing
behavior of exporting the receiver while also flagging the receiver
for audit before the U release.

Bug: 234659204
Test: Build
Change-Id: I6660cfb00244470edfb2411dadfca81afed42343
2022-10-04 17:15:36 -05:00
vadimt
592b3f9885 Verifying a theory that sometimes a leak disappears while saving an object dump
Bug: 241585675
Test: presubmit
Change-Id: If9c559619507002ed7ec4b1a8b96a5f62e2dbe41
2022-09-21 10:56:04 -07:00
Sunny Goyal
20bbe95ddb Updating the scroll calculation from recyclerView to avoid view inflation
> Updating the LayoutManager's scroll calculation instead of a separate
  implementation to better support recyclerView's calculations
> Caching the view sizes during layout to avoid view-inflation for
  unknown types
> Fixing scrollbar jump during scroll when widget list is expanded
> Fixing scrollbar never reaching end when onboarding card is displayed
  in work tab

Bug: 240343082
Test: Verified on device that new views are not inflated
Change-Id: Ied11ccf65b053691c5c126c4bf8de306ec24786d
2022-09-12 12:24:34 -07:00
Sebastian Franco
314bbf1cba Adding support to add icons in the workspace for tests
Test: atest ReorderWidgets
Bug: 243440737
Change-Id: Ic656cef079be965d17ab1b58d5f73ce955c9374c
2022-08-31 16:29:53 -07:00
vadimt
f6ef879cf4 Moving all sources that are shared between Launcher and TAPL in one directory
This will help SysUI test team (who uses TAPL) to set up Gradle build for their tests.

Bug: 202567877, 234414088
Test: presubmit
Change-Id: I3d923ea4b54d1a4c3d2b345be09692727d30433e
2022-07-27 20:18:46 +00:00
Tracy Zhou
86a844c976 Add splitFromOverviewForTablet test
Design doc: go/split_tapl

Bug: 238553914
Test: run this test

Change-Id: Ibb385d852f73dee10470d14c4962cf482740105d
2022-07-19 01:57:35 +00:00
Nicolo' Mazzucato
f67536e1eb Allow workspace to provide icon positions in tests
This is needed in order to implement a test for the unfold animation.
getWorkspaceAndHotseatIconsPositions returns map that associate icon name with its center on the screen

Test: atest TaplTestsLauncher3
Bug: 220087235
Change-Id: I254aa0c146edf4cae1c2bf5c09dec000993eb4d8
2022-05-04 20:27:11 +00:00
Anushree Ganjam
5cc7ff0990 Revert "Refactors Search results into separate RV for Toast."
This reverts commit 6729f0b950.

Reason for revert: This change caused b/230648542.

Please see https://b.corp.google.com/issues/230648542#comment5 for the video after reverting this change.

Bug: 206905515
Bug: 230648542

Change-Id: I85f063c56cad137c05b810204244bba7e8f94ee7
2022-04-28 01:37:49 +00:00
Andy Wickham
6729f0b950 Refactors Search results into separate RV for Toast.
This will help enable transitions between A-Z apps lists and
search results because both can be seen simultaneously and
manipulated independently.

Some high level items of the refactor:
 - SearchRecyclerView is added; logic that populated the main
   (personal) tab with search results was simply redirected to
   this RV instead.
 - BaseAllAppsContainerView added isSearching() method. Returns
   false, and ActivityAllAppsContainerView overrides (as search
   is handled there).
 - Renamed BaseRecyclerView to FastScrollRecyclerView to better
   describe what it does. SearchRecyclerView extends this, but
   returns false for supportsFastScrolling().
 - AlphabeticalAppsList#mAllAppsStore is now optional, so the
   Search RV doesn't need to store/listen to apps. Note this
   doesn't affect the predicted app row which is still updated
   if one of the predicted apps is uninstalled (I tested this).

Future work:
 - Determine why dispatchRestoreInstanceState is not called for
   BaseAllAppsContainerView. Save is called, e.g. on rotation.
   Effect of restore not called: rotating while searching goes
   back to A-Z list.
 - Keep suggested apps in Header while searching. Currently they
   are rendered in the SearchRV above search results, as before.
 - Potentially extract Personal/Work tabs to move independently of
   header.
 - AlphabeticalAppsList is a misleading name because it can also
   contains search results. However, things are pretty intertwined
   between that and BaseAllAppsAdapter (effectively a circular
   dependency), so I figured cleaning all that up was out of the
   immediate scope of this refactor, which is mainly meant to
   unblock transition work.

Bug: 206905515
Test: Manually checked for regressions, ran tests.
Change-Id: I4d3757c8a8f9b774956ca6be541dd4fcdad1de13
2022-04-24 17:36:48 -07:00
vadimt
25fbd5b0bb Sampling too long Launcher tests
A test that takes > 3 min will generate an artifact file containing stacks of all threads of the test process taken every 3 sec. This artifact will be also generated if the test process is killed, for example, by timeout.

This artifact should help EngProd's effort to speed up presubmits.

Bug: 225186335
Test: local runs
Change-Id: I721779bfbe5bc6289315998ed2660f5f46165611
2022-04-19 18:02:56 -07:00
Schneider Victor-tulias
fb252e7ce1 Add taskbar TAPL tests
- Added TAPL objects to support TAPL tests for taskbar features
- Added tests for major taskbar features: hiding/showing the taskbar, opening all apps, lauching apps and app deep shortcuts from the taskbar/all apps page, launching apps and app deep shortcuts in splitscreen
- These tests should only run for large devices

Design: go/taskbar-tapl-tests
Test: ran tests locally with invalid configurations and remotely
Bug: 215218813
Change-Id: I3c28c339707467414aa47fa633f87fa0c1fdee57
2022-03-10 13:02:35 -08:00
TreeHugger Robot
90ab34b1d8 Merge "Revert "Adding better diags when SysUI crashes during Launcher test"" into tm-dev 2022-03-07 23:14:49 +00:00
Vadim Tryshev
fcd569055e Revert "Adding better diags when SysUI crashes during Launcher test"
This reverts commit b0e0f5f44a.

Reason for revert: This cl prevents the ability to run tests from android studio.

Change-Id: I8a1cbcd2e8faefdd168aac5bcad4f21c73694839
2022-03-07 20:37:42 +00:00
Benno Lin
894984299f Fix Tapl drag to folder issue on S5 and R3
Bug: 205015793
Bug: 205014516
Test: atest Launcher3Tests
Test: https://android-build.googleplex.com/builds/abtd/run/L47800000953216369
Test: https://android-build.googleplex.com/builds/abtd/run/L63300000953213948
Change-Id: If481d2b6503e8d47953b00c102719c447f43da41
2022-03-04 00:58:33 +00:00
vadimt
b0e0f5f44a Adding better diags when SysUI crashes during Launcher test
Test: presubmit; sys ui tests where this rule is already used
Bug: 187761685
Change-Id: Ib4491e5c7ebbea0bb3b17fc8c4b3a6c59a3bdb2a
2022-02-28 18:59:25 +00:00
Schneider Victor-tulias
d6279ae641 Update TAPL object hierarchy in preparation for Taskbar TAPL tests
See design at: go/taskbar-tapl-tests

Test: Ran tests remotely
Bug: 215218813
Change-Id: I1c2ceac8954973ea3ae5b2f797fdfb96ba7a6ec4
2022-02-15 13:33:26 -08:00
Vadim Tryshev
21720c9a2c Revert "Revert "Removing unused tracing""
This reverts commit 827335f209.

Reason for revert: Problem solved

Bug: 195319692
Test: presubmit
Change-Id: I084c8a6b6acdaa3ee4697fc752e817d292ba0665
2022-01-22 02:46:02 +00:00
vadimt
abe8e3a947 Not generating memory dump for intentional leak tests
Memory dump can be generated only once, so generating it in the intentional leak test leaves us without a meaningful dump if a real leak happens later, and produces a confusing message that the dump was already generated.

Bug: 195319692
Test: presubmit
Change-Id: I35932deba0c46ddb27362467109daf74d75cbff4
2021-12-20 12:35:53 -08:00
vadimt
bc1da4ca98 Improving memory dump diag
atest deletes artifacts directory on the device, but saves artifacts at the host machine.

Bug: 187761685
Test: presubmit
Change-Id: I1f5244ebfe6b606c4891f5fca003541b27cc944c
2021-12-09 21:58:45 +00:00
Alex Chau
31b46953cb Add timeout to AbstractLauncherUiTest.getOnUiThread
- Send signal 6 to Launcher process when this happens to get a thread dump

Bug: 203416429
Test: labtest
Change-Id: If22b58418be33131e7f585e718a2197cda2e7365
2021-11-22 18:36:11 +00:00
Jon Miranda
8568602aaf Add back waitForStateTransitionToEnd to fix flakiness.
Bug: 202735477
Test: presubmit
Change-Id: I03c7e8b0c40177f4e6e38a7d9aa3e01b029effd6
2021-11-09 17:02:31 -08:00
Jon Miranda
f37d7a21f2 Add resume check to other WorkProfileTests to fix flakiness.
- Tests were flaky with waitForStateTransitionToEnd
- Tests stopped flaking with both waitForResume and waitForStateTransitionToEnd
- waitForResume may be enough to fix the flakiness, so
  removing waitForStateTransitionToEnd for now, if flakiness
  returns we can add it back

Bug: 202735477
Test: presubmit
Change-Id: Ib9cc16ea7815387582486517a87249d0053475f6
2021-11-09 10:14:01 -08:00
Jon Miranda
a234a8ea85 Testing to see if waiting for transition to end will fix flaky tests
Test: presubmit
Bug: 202735477
Change-Id: Icf62003b9f422cf0e327365260c36f6d57b71aef
2021-11-05 12:31:15 -07:00
Alex Chau
a917d24d2b Merge "Testing to see if using isInStableState is better condition vs getCurrentStableState" into sc-v2-dev 2021-11-04 17:43:35 +00:00
Jon Miranda
f3fbc935cd Testing to see if using isInStableState is better condition vs getCurrentStableState
Test: presubmit
Bug: 202735477
Change-Id: I06c964cc92b7731e73628210688817e2d9cf1bac
2021-11-03 11:42:01 -07:00
Benno Lin
6c00386c2b Implement pressing back button and swiping back
This CL implements a pressBack function to press back button or swiping
back in gesture navigation mode.

Bug: 199120092
Test: atest -c Launcher3Tests:com.android.launcher3.ui.TaplTestsLauncher3#testPressBack &&
    atest -c NexusLauncherTests:com.android.quickstep.TaplTestsQuickstep#testPressBack
Change-Id: I001cea17d09ae1ab7952d04ee394a2afa5bf1e67
2021-11-03 02:28:37 +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
sfufa@google.com
9f0981dc4f [Work profile][Test] Remove tracing logs for testWorkeduFlow
Bug: 159671700
Test: NA
Change-Id: I097134c45155f0e65ef4376fab803796f3fdb12a
2021-10-07 16:48:41 -07:00
vadimt
5ade8e890d Moving activity tracker to Launcher process
This will improve diagnostics for OOP tests,
like we now have a list of leaked activity classes.

Also some cleanups.

Bug: 187761685
Test: local runs
Change-Id: I8b5711ac727874fd826cfef9c742ea97048763e0
2021-09-27 17:36:14 +00:00
Sunny Goyal
4af8cf9269 Updating test build rules
> Moving definition to bp files
> Adding mokito-inline to allow mocking final classes
> Moving src_common to src to avoid unnecessary code split

Bug: 196825541
Test: Presubmit
Change-Id: Ib6879cda6aee74f5b9050a16eb6ca94ed3b7e28c
2021-08-18 10:22:52 -07:00
Vadim Tryshev
ed53d1c21c Revert "Revert "Removing workaround for battery defender""
This reverts commit f9ccf0175d.

Reason for revert: to see whether b/151613234 is fixed

Test: pre-, post- submit
Bug: 151613234
Change-Id: Ieda2907319d796a57494318920c22f3db4527dab
2021-08-05 20:52:58 +00:00
TreeHugger Robot
1179930b74 Merge "Logging to figure out why first dump didn't result in assertion" into sc-v2-dev 2021-08-03 20:05:19 +00:00
vadimt
25f1cd94cc Logging to figure out why first dump didn't result in assertion
Bug: 195319692
Test: presubmit
Change-Id: I4a80541a58eb8f630211de4b90836c435f6d41b2
2021-08-03 11:09:30 -07:00
Alex Chau
c2181c2be4 Re-enable leak detection on tablets
Bug: 191449914
Test: NexustLauncherTests
Change-Id: Ia2fe0826c933e646260c16d8890aaf2a47023e6d
2021-07-20 12:27:51 +01:00
TreeHugger Robot
9f867ac8b6 Merge "Enabling screen record for some flaky tests" into sc-dev am: 5c6d7c3a1f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15112968

Change-Id: I188875721529cbb36fd5ae37fb304953125802fc
2021-06-26 15:10:36 +00: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
Alex Chau
7a9972289f Add touch event of on taskbar for various cases
- Temporarily disable leak detection on tablets until b/191449914 is resolved
- Add touch event on taskbar when interacting with navigation buttons
- Added TaplTestsLauncher3.initialize to StartLauncherViaGestureTests which is present in TaplTestQuickstep to solve LauncherInstrumentation being null problem on tablets

Bug: 191344757, 191449914
Test: TaplTestQuickstep and StartLauncherViaGestureTests
Change-Id: I49accc458d133717f290140abe80aae8a683f6c0
2021-06-24 18:00:12 +01:00