Commit Graph

73 Commits

Author SHA1 Message Date
Vadim Tryshev
4d3179706a Removing verifying motion events in TAPL
This allows us to simplify GestureScope.

Bug: 187761685
Test: presubmit
Flag: N/A
Change-Id: I0ca0add5ef41ddd74a8fe3b4ebca10e0f866bf55
2023-09-06 13:08:31 -07:00
Treehugger Robot
bc6e67da45 Merge "Skips checking for overview actions when grid only overview flag is enabled." into udc-qpr-dev 2023-08-17 23:12:08 +00:00
Pat Manning
dc90a46e77 Skips checking for overview actions when grid only overview flag is enabled.
Fix: 296060682
Test: TaplTestsQuickstep
Flag: ENABLE_GRID_ONLY_OVERVIEW
Change-Id: If8ef23767350dbbcf80294abf6b93eebe57d3487
2023-08-15 16:55:23 +01:00
Sebastián Franco
1f4d56c01e Revert "Remove flags ENABLE_TWO_PANEL_HOME FOLDABLE_WORKSPACE_REORDE and FOLDABLE_SINGLE_PAGE"
This reverts commit 76a1ceb5f2.

Reason for revert: Add flag back to turn it off for further testing

Bug: 270395274
Merged-In: I10b9e99734b14cbbe8d1190300493099a1f28a24
Change-Id: I10b9e99734b14cbbe8d1190300493099a1f28a24
2023-08-09 20:43:47 +00:00
Sebastian Franco
a99e1d2a14 Ensure the reorder test runs on the foldable devices
It moves some classes form the Nexus package into the launcher package
so it can be used in both projects.

It also adds more test for foldables and test multiple
grids for each test.

Bug: 289584301
Fix: 291346193
Test: ReorderWidgets
Change-Id: I04db5f685d0344b8a3f3d42b429bbde061b3d8ea
2023-08-03 16:35:29 -07:00
Sebastian Franco
76a1ceb5f2 Remove flags ENABLE_TWO_PANEL_HOME FOLDABLE_WORKSPACE_REORDE and FOLDABLE_SINGLE_PAGE
Fix: 270392643
Fix: 270395070
Fix: 270395274
Test: atest FoldableItemsIntegrity
Change-Id: I2d7af312da8aeb070588ca94a2a256d2def65eeb
2023-06-12 18:05:22 -07:00
Tracy Zhou
6a71c2a6f5 [Trackpad] Gesture navigation in 3-button mode
Back gesture will be in a separate change

Bug: 279948218
Test: https://recall.googleplex.com/projects/3388b17c-d22f-46f8-b140-a102690377b4/sessions/0b8e838a-89b0-4451-ad44-df2916db877d
Change-Id: I1f14ca873efa33684e36ac1f0f72d766815752ae
2023-05-21 22:45:37 -07:00
Sebastian Franco
25423867af Fixing test that fail when FOLDABLE_SINGLE_PAGE is set to true
We need to change the result of REQUEST_IS_TWO_PANELS when the
flag is on because now we don't have two panels only 1.

Another of the issues is a rounding error when calling
getUnusedHorizontalSpace().

And lastly updating workspaceToBoards so that it maps the coordinate
of workspace items to their right position.

Bug: 270395274
Test: atest ReorderWidgets
Change-Id: I2620e5bf1ba132f984e00d2a6c21081953d259fd
2023-03-20 17:06:20 +00:00
Sebastian Franco
81b82720de Making ReorderWidget test more reliable
In some cases when starting to drag you can go to the next
CellLayout wich end in an error. Now the dragging functions
will move the item to the desired CellLayout no matter what
CellLayout you start in.

Fix: 266116487
Test: atest ReorderWidgets
Change-Id: Ie3ad2ff88f734856e2c66d5d51b7578482877b5a
2023-02-13 11:02:09 -08:00
TreeHugger Robot
becfd2ac75 Merge "Marking that we process REQUEST_ENABLE_ROTATION" into tm-qpr-dev 2023-02-07 01:39:02 +00:00
vadimt
3c2ab8b1e1 Marking that we process REQUEST_ENABLE_ROTATION
Bug: 187761685
Test: presubmit
Change-Id: I8239cd59dada685618fb273ef5840d30756ec84a
2023-02-06 15:00:49 -08:00
Andy Wickham
8d004b0f49 Update tests to support floating search.
Tests need to be updated to account for the new placement of the
searchbar because it overlapped with touch events for scrolling:
 - Scroll back to top: Instead of scrolling from the top of the
   container which could overlap status bar in landscape, scroll
   from the bottom of the top-most visible app icon.
 - Scroll down: swipe up from bottom padding to top of top-most
   visible icon.
 - Close all apps: swipe down more quickly from top icon insetad
   of the search bar (more quickly helps it be detected as a
   fling on more cramped devices).

For Launcher3, the floating flag is not fully supported yet, so
there were some layout issues which are now resolved by ignoring
the flag if the searchbar is still at the top.

Fix: 268052768
Test: Ran tests, manual
Change-Id: If54717e2835c7cc4ed1368554bbc493193945c1d
Merged-In: I406fbcbe12acddb1dd4b862a380576a48cabbebc
2023-02-06 13:49:14 -08:00
Sebastian Franco
de1fe14a47 Adding the avility to add icons on multiple CellLayouts on tests.
I needed to change the code so that you can pass the CellX/Y
position to the drag function instead of the pixel coordinates
and we can pass X position bigger than one CellLayout.

Also, I notice that getCellCenter only worked for 1x1 items
so I added the option to specify the widget size.

Fix: 262431878
Test: atest ReorderWidgets#multipleCellLayoutsSimpleReorder
Change-Id: I3b09de770e8f99aa10cae8cea32e7e6bc02c7b8b
2023-01-16 10:32:40 -06:00
Sunny Goyal
50097ef272 Waiting for app install to finish before procedding with the test
Bug: 256659409
Test: Presubmit
Change-Id: Ia0f4cdd072c4c439d09070b0395fcfd6909c2a8f
2022-11-03 13:33:41 -07:00
Tony Wickham
6b32ce07b1 Merge "Decrease TAPL All Apps scrolling flakiness" into tm-qpr-dev 2022-11-02 15:39: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
Schneider Victor-tulias
ee0bc03d58 Decrease TAPL All Apps scrolling flakiness
scrolling in all apps did not factor in additional top padding in the all apps list recycler. This made it so that apps could occasionally scroll and be obcured by that top padding, making them un-tappable. Added this padding to the scrolling logic to make scrolling less flaky.

Test: TaplTestsTaskbar, TaplTestsLauncher3 and presubmit
Fixes: 248064856
Change-Id: Id76b92b4bc354917f3688ac53673d0ed7a905f02
2022-10-21 12:12:38 -07: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
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
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
Chilun Huang
ac57ddeb4c Workaround to return 1/3 of the position
Some devices in portrait mode have the same symptoms as b/234322284.
Simply return 1/3 of the position like the X axis to solve the problem.

Bug: 238202110
Test: atest Launcher3Tests:TaplTestsLauncher3#testAddDeleteShortcutOnHotseat
Change-Id: Ic7d3756cfbda6673a62b266c6093745b8311e6ac
2022-07-11 15:19:16 +08:00
Tony Wickham
0c8ceda6e7 Merge "Move TEST_HARNESS_TRIGGER_TIMEOUT to MotionPauseDetector directly" into tm-qpr-dev 2022-07-06 16:25:03 +00:00
Tony Wickham
539c2703ea Move TEST_HARNESS_TRIGGER_TIMEOUT to MotionPauseDetector directly
- Removed TestProtocol.sForcePauseTimeout and
  TestProtocol.REQUEST_SET_FORCE_PAUSE_TIMEOUT
- Instead, add MotionPauseDetector.TEST_HARNESS_TRIGGER_TIMEOUT, which
  is used when Utilities.IS_RUNNING_IN_TEST_HARNESS.

Test: unbundled/launcher/launcher3_test_platform
Fixes: 232548865
Change-Id: I224e99042b41375cab6bffd555434217518958c5
2022-06-30 12:16:08 -07:00
Chilun Huang
7662dae663 Add TAPL API for adding app icon to hotseat
Please refer to go/tapl-add-icon-to-hotseat for more details.

Bug: 231400119
Test: atest NexusLauncherTests:TaplTestsQuickstep#testAddDeleteShortcutOnHotseat
Change-Id: I8cadecbe742413e3ce35ff269c0f78057331532c
Merged-In: I8cadecbe742413e3ce35ff269c0f78057331532c
2022-06-27 11:10:21 +08:00
Abhilasha Chahal
997a757661 Check if launcher has touch interaction service when registering touch events
Bug: 228014625
Test: Refactoring change

Change-Id: I3b94f4f7fabf7cb2964eefd5cf1e099d2bb80ca6
2022-05-06 16:21:48 +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
Shikha Malhotra
f78da1bae3 Review comments followup
These are review comments followup from ag/17399997

Bug: b/218187058
Test: manually test thet Launcher3 features work correctly
Change-Id: I9865a37c1ed663370dc28e7678994f3d961e3cd1
2022-04-12 14:33:07 +00:00
Benno Lin
7738cac424 Implemnet methods to drag a icon to given Workspace cell
The CL implements public methods to drag an Icon from AllApps to a
given cell in the workspace.

Bug: 199120092
Test: Launcher3Tests:com.android.launcher3.ui.TaplTestsLauncher3#testDragAppIconToWorkspaceCell
Test: https://android-build.googleplex.com/builds/abtd/run/L89300000953052361
Test: https://android-build.googleplex.com/builds/abtd/run/L44500000953013792
Change-Id: Ife16d1f1b55b809763dd40f5afee6711049a4729
2022-02-15 01:48:45 +00:00
vadimt
462fe7c007 Allowing OOP tests to enable home screen rotation.
Bug: 202567877
Test: local runs
Change-Id: Ifb711a3071a26e2d8e690e0378b6e74146ac722c
2021-11-03 18:39:01 -07:00
Benno Lin
5261776d3a Update TAPL to operate on folder icons.
The change updates features listed as follow:

1. Create a new class for folder icon.
2. Implement function to drag a icon to the other.
   (create a folder)
3. Find folders in a workspace.

Bug: 199120092
Test: Launcher3Tests:com.android.launcher3.ui.TaplTestsLauncher3#testDragToFolder
Change-Id: I3044025f8297f6e442446d70238f4b56f38a798a
2021-10-25 11:08:44 +00:00
Tony Wickham
21970ccd29 Remove nonOverlappingTaskarInsets
- Override our insets in LauncherRootView to explicitly only care about nav bar size, ignoring any insets due to taskbar.
- Previously we used nonOverlappingTaskbarInsets to belatedly subtract from measurements in e.g. DeviceProfile, but now we can revert most of those calculations since we effectively subtract taskbar insets at the root.

Test: visual in different orientations and navigation modes, and testPressHomeOnAllAppsContextMenu to ensure REQUEST_WINDOW_INSETS still works for automated tests
Fixes: 200607741
Change-Id: I8de5a268c686a1354b4beaa30e101bab6bed5af9
2021-09-21 13:52:43 -07:00
Alex Chau
e9dbb0d952 Use windowInsets for bottomGestureSize instead of gestureInsets
- getTargetInsets will be reverted to its behavior before ag/15431427
- getBottomGestureSize will use the new getWindowInset call uses windowInsets instead of the max of windowInsets/gestureInsets, with the taskbar inset calibration

Bug: 195263971
Test: com.android.launcher3.ui.widget.AddWidgetTest#testDragCustomShortcut
Change-Id: I89368edee5252a404ef490db6540734ec4806f2b
2021-08-09 18:49:29 +01:00
vadimt
6b534ee54f Diagnose when lab device sends fake touch screen events to test
Bug: 189874683
Test: local
Change-Id: I8ac569ab049bafaa0a6263598f2b43a99386e6d9
2021-08-06 15:49:02 -07:00
Alex Chau
0dfe56cff1 Increase motion pause timeout for tests
- In cuttlefish occasionally MOTION_MOVE and MOTION_UP takes more than 300ms due to lag, increasing the motion pause timeout to avoid getting false signals in tests

Bug: 194114179
Test: atest NexusLauncherOutOfProcTests:com.android.launcher3.memory.MemoryTests#testAppLaunchFromWorkspace
Change-Id: I0a33f34b5bf96f4f7ae56020c5a27f4ef9a0ff64
2021-08-04 20:09:06 +01:00
Alex Chau
6951aef060 Fix Launcher3 tests for tablets
- Consider taskbar size for bottom gesture size, by using TargetInsets
- TargetInsets should substract overlapping taskbar size when it's present
- For pressHome, use the same gesture scope when context menu is present as well.
- For pressHome, GestureScope.INSIDE_TO_OUTSIDE should only be used when it's already at home screen on launcher3 tablet.

Bug: 193539246
Test: NexusLauncherTest and Launcher3Test
Change-Id: I4a20522f3b38ef326acae4b189df11a125990411
2021-07-30 20:39:05 +01:00
Alex Chau
0686931b68 Use DeviceProfile.isTwoPanels for two panels expectation in tests
Fix: 193810767
Test: TaplTestsLauncher3.testWorkspace
Change-Id: Ifec5506415b79f3effa84fe0163eb1bb2bc7cc8d
2021-07-16 15:14:34 +00:00
Vinit Nayak
b974a86c8f Add IDs to buttons in 3 button nav for Taskbar
Bug: 191449914
Test: testSwitchToOverview passes
See bug for more details

Change-Id: I108bbe7607181680bca7cb5fad5e7289191edde6
2021-06-18 18:20:44 -07:00
Steven Ng
2f5648a911 Refactoring before adding a new view type in the WidgetsListAdapter
Changes made:
1. Model: added an abstract class for storing common information for
   entries shown in the full page widgets picker.
2. Introduced a ViewHolderBinder interface to split the logic of binding
   data to ViewHolder into separate classes.
3. Move the view holder binding of WidgetsListRow from WidgetListAdapter
   to its new class.
4. Move some widgets picker classes into a new picker package.

Test: Auto: Run WidgetsListAdapterTest, WidgetsListRowEntryTest and
      WidgetsListRowViewHolderBinderTest.
      Manual: open the all apps widgets tray and navigate the list.

Bug: 179797520
Change-Id: Iab29557842bb79156cad84d00a4c5d0db0c5aa06
2021-02-10 21:23:40 +00:00
vadimt
fb099c7fe1 Improving diagnostics when can't find a widget
Instead of "exceeded number of attempts" now printing that can't scroll
to widget.

Change-Id: Ia6f582e038d68fc35f152d94e592f60ef0bc2cf4
2020-06-24 21:54:16 +00:00
vadimt
45564c831b Removing debug requests from non-debug test info handlers
Bug: 152629799
Bug: 153670015
Change-Id: I02776be811d1d3325b35880d19d25a6638f904ef
2020-06-10 18:48:37 -07:00
Vinit Nayak
6b7cc3fdc2 Re-enable orientation sensor for Overview animation
Slight revert of ag/10668129 with adjustment
of disabling it for tests.

Fixes: 151456795
Test: Ran the labtest command for OOP
tests for crosshatch (where this issue
was first detected)

Change-Id: I315d138c2e4a6d4068304e9b5fb2e1b7feb34e63
2020-04-02 11:07:10 -07:00
vadimt
2e1e0d6bff Removing tracing for "Launcher didn't initialize" flake
The flake had disappeared, perhaps because of this logging, or,
hopefully, for some other reason.

Bug: 148313079
Change-Id: I636783d5fc71474dd443c143289c3ff74651835e
2020-02-10 12:47:42 -08:00
Sunny Goyal
5fffa47cac Fixing race condition on test information provider
Activity tracker is accessed on a non-UI thread, which can cause a non-initialized
Launcher to be treated as initialized

Bug: 149022794
Change-Id: I6634a6aff891592369c16469bbe95a9ea611819c
2020-02-07 12:37:44 -08:00
vadimt
c8b09709ff Tracing for another "Launcher didn't initialize" failure
This simply restored logging used for one of earlier investigations

Bug: 148313079
Change-Id: Idafed13208dc5610d577986fc487d1d44bc0ef5e
2020-01-27 17:48:49 -08:00
vadimt
9675452c2f Better diags and a small correction for scrolling in AllApps
Change-Id: I48dbba26139f42350831fb707bea847b7c76129f
2020-01-14 19:39:35 -08:00
Pinyao Ting
654adf657e integration test for open settings menu from workspace.
compare pid of launcher process after test execution to verify launcher isn't crashed when running in oop test.

Bug: 147235759
Change-Id: Id13c47f5c4e388cc8e95b19d099e94a2e540bf3f
Test: fun flake locally
2020-01-08 17:01:39 -08:00
vadimt
480083490f Tapl: AllApps: ensuring a minimal vertical size of an icon
Clicking an icon within its padding area is ignored by Launcher. Hence,
ensuring that the whole icon is visible.

Bug: 141770616
Change-Id: I19e3ba7cfa25de75a47202845d0838bea46af92c
2019-11-13 20:20:57 +00:00
vadimt
56b800bfea Reducing chances for the object with finalizer to be reffed by register
As suggested in b/143155020#comment27

Bug: 143155020
Change-Id: I4ed87a003fcd7afde213014fc1ba8b004500e71a
2019-10-25 18:12:25 -07:00
vadimt
23c8341096 Removing tracing and @Stability for a fixed bug
Bug: 142514365
Change-Id: I147850db274c465fb964eca30b97b3ebaaa2ccf6
2019-10-25 11:21:33 -07:00