Commit Graph

223 Commits

Author SHA1 Message Date
Schneider Victor-tulias
67ca528591 Update TestProtocol.REQUEST_CLEAR_DATA to properly clear the workspace
Flag: not needed
Fixes: 287097473
Test: TaplTestsLauncher3
Change-Id: I980a68dff8b475ce8f7b86284663f697b7bc2b57
2023-06-28 10:37:44 -07:00
Vinit Nayak
710b5ba162 Add logs to determine if grid positions incorrect
* Either positions are incorrect, or maybe we
need to clean-up existing shortcuts if they are in
incorrect position in the grid

Bug: 282963545
Change-Id: I5d32d130d0e05bde69eda9d73468eda49a4f2802
2023-06-23 15:42:53 -07:00
vadimt
95c1dc70b4 Saving view capture data before cleaning it in ViewCaptureRule
This makes it reliably available to FailureWatcher who saves the
 artifact afterwards.

Test: local, presubmit
Flag: N/A
Bug: 286251603
Change-Id: I11b4854684f6ba5c798096eac223760d76f004b1
2023-06-15 16:20:04 -07:00
vadimt
62f24f63ad Moving ViewCaptureRule to inside of FailureWatcher
Goal: ViewCaptureRule finishes recording before FailureWatcher starts saving
  artifacts, including view capture.

Also starting recoding without waiting for activity creation if there is
already a Launcher activity.

Test: local, presubmit
Flag: N/A
Bug: 286251603
Change-Id: I191d3cdde76e9f906453b20325862f2bcff9024c
2023-06-14 17:39:48 -07:00
Vadim Tryshev
6d31bf9368 Merge "Adding a rule for analyzing view capture data" into udc-qpr-dev 2023-06-09 00:13:38 +00:00
vadimt
de54cb8fa5 Adding a rule for analyzing view capture data
For now, the rule is basically empty, to start with. In the following CLs it will
invoke the search for anomalies in the data collected by ViewCaptureRule
after the test succeeds and fail the test if an anomaly is found.

Bug: 286251603
Test: presubmit
Flag: N/A
Change-Id: I373ea0d7ee85206101fb15584889ea5933e7d7b8
2023-06-07 17:39:54 -07:00
Sunny Goyal
7b9e28f152 Removing all usage of LauncherProvider
Also fixing a race condition in model when an item update/delete task
gets queued and executed after the model has reloaded (making the old
data obsolete)

Bug: 277345535
Bug: 263079498
Test: Presubmit
Flag: N/A
Change-Id: Ibd4bdbb3eece05b38b73a22a4be5f368df3754f0
2023-06-07 12:57:13 -07:00
Sunny Goyal
ee9740462e Simplifying some test utility methods
Bug: 283821111
Test: Presubmit
Flag: N/A
Change-Id: I7b9690bc0cc53d097d26cd4f0ab2dd36ba88e1cb
2023-06-02 13:30:55 +00:00
TreeHugger Robot
f95fca0f5d Merge "Insert a check that keyguard is invisible into waitForLauncherCondition" into udc-dev am: db7009544e am: 03d0cd83a9
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23441208

Change-Id: Ib4549e9712251a6c9eb85dfb5229d2d7addc4482
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-31 21:26:42 +00:00
Stefan Andonian
55d0d21040 Merge "Revert "Keep ViewCaptureRule logic self-contained."" into udc-dev am: 57eaf86f8d am: fc7e8fa4c2
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23454664

Change-Id: I0da767add8247c3530af0a26e965d6830018ef75
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-30 19:02:56 +00:00
Alex Chau
6565b68168 Merge "Add Portrait/Landscape support for NexusLauncher screenshot tests" into udc-qpr-dev 2023-05-30 15:54:10 +00:00
Stefan Andonian
0a8fab01da Revert "Keep ViewCaptureRule logic self-contained."
This reverts commit eec7a9d90f.

Reason for revert: Failing tests.

Change-Id: Idf16453bbd7f0ace17d8e80d3303fae26b50333b
2023-05-26 21:11:41 +00:00
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
eec7a9d90f Keep ViewCaptureRule logic self-contained.
This will make it easier for other apps / processes to integrate the
ViewCapture logic into their integrated testing frameworks.

Bug: 270158224
Test: Verified that a zip file was generated properly and was able to be
loaded into go/web-hv properly.

Change-Id: Ib3e4a0b60497937b750126590071884882b22917
2023-05-25 17:59:46 +00:00
Jordan Silva
aac286af4f Add Portrait/Landscape support for NexusLauncher screenshot tests
Updating @PortraitLandscape annotation to be public to allow its usage by modules implementing Launcher3 and AbstractLauncherUiTest and interop with Kotlin.

Bug: 283751050
Flag: N/A
Test: atest HomeScreenEditStateImageTest
Change-Id: I84e1210c0476a3b3f9b40bbb6ee6b46a44b752ff
2023-05-25 02:25:19 +01: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