Commit Graph

14 Commits

Author SHA1 Message Date
Sebastian Franco
877088e6c3 Change the access of cellX/Y of CellLayoutLayoutParams to private
Bug: 188081026
Test: no op change, should compile
Test: ReorderWidgets
Change-Id: I20367974e5a4cead406e18eb66dafd4d59651b2a
Merged-In: I20367974e5a4cead406e18eb66dafd4d59651b2a
2023-01-13 18:25:10 +00:00
Sebastian Franco
f34f35fddb Printing the workspace items to improve flake investigation.
Recording the screen to investigates flakes on ReorderWidgets
is really useful but it requires changing the code for that and
storing the video and most of the time the useful information
is just the end state so by logging the end state makes resolving
flakes easier

Fix: 261877803
Test: atest ReorderWidgets
Change-Id: If5d9745ebb57826a55b5df9d3599eed56c48298f
2023-01-06 12:29:11 -06:00
Sebastian Franco
150e572e05 Ignore all launcher3 flaky test so that they come back online
Test dashboard: https://android-build.googleplex.com/builds/tests/search?filter=mediumFailureRate&filter=highFailureRate&query=config%3Av2%2Fgnl-eng%2Funbundled%2Flauncher%2Flauncher3_test_platform+latest%3A4d&tab=tests

Test: dashboard should not show flaky tests
Bug: 256832045
Change-Id: I06e879dec2703455b7be728c7afd3500d2edd54a
2022-12-06 17:08:45 -08:00
Sebastian Franco
5356ff955c Creating a new alarm when drag X,Y change
If the user is changing the X and Y of the reorder, wich requires
the user to move at least one Workspace cell from the previous
position, then it doesn't make sense to wait for the previous alarm to finish
to start a new reorder.

Also, I added a new test to run on foldable devices.

Fix: 259995663
Fix: 259295374
Test: atest ReorderWidgets (it mostly fails on postsubmit)
Test: modify ReorderWidgets.fullReorder to run 20 times and it should work, before the chagne it would fail.
Change-Id: Ic6b436ea1088f8092c849e9791862947e9035c9f
2022-12-05 16:37:45 -08:00
Sebastian Franco
ac53846195 Ignore test while the solution for the flaky tests improve.
Bug: 261178121
Test: atest ReorderWidgets
Change-Id: Id0c6594e00486695c63e2cda53b1a5ee39478a1f
2022-12-02 11:33:00 -08:00
Sebastian Franco
285b749bcf Wait in ReorderWidgets test for the workapce to load after changing it.
Fix: 252860608
Test: atest ReorderWidgets
Change-Id: Idf99188837a475d0327174e264ab1d23d646d75d
2022-10-27 14:42:19 -07:00
Sebastián Franco
09a98dfdbd Merge "Revert "Prevent dragging widgets to another page in tests when starting a drag."" into tm-qpr-dev 2022-09-16 16:49:26 +00:00
Sebastián Franco
a798be2ff5 Revert "Prevent dragging widgets to another page in tests when starting a drag."
This reverts commit 749b2b8493.

Reason for revert: Causing tests to fail b/246972374

Change-Id: I9fc1f6d2e924f4ac5484c6674fd0adf49d04536f
2022-09-15 21:19:12 +00:00
Sebastián Franco
610db4fc94 Merge "Prevent dragging widgets to another page in tests when starting a drag." into tm-qpr-dev 2022-09-15 17:19:42 +00:00
Sebastian Franco
749b2b8493 Prevent dragging widgets to another page in tests when starting a drag.
The function Launchable.startDrag it's supposed to grab and icon or widget
and start the dragging by moving it only in the verticall position but
because it uses the coordinates of the object before entering the
SPRING_LOADED_STATE_ORDINAL state then the coordiates where it moves
are outisde of the cell layout and it moves to a new page. This only happens
if the phone is too slow and it triggers the page change, otherwise it would
be too fast.

To fix it, I'm moving the icon/widget to the center of the screen minus
getStartDragThreshold() to ensure the drag is always triggered.

Fix: 242323136
Fix: 244224955
Fix: 241019568
Fix: 241583798
Test: atest ReorderWidgets
Change-Id: I0e431b994aa4a3d5c8be45b6c73263732553b36c
2022-09-13 15:54:58 -07:00
Sebastian Franco
5434c9d370 Add hotseat icons to TestWorkspaceBuilder and submit everything in a batch
Now TestWorkspaceBuilder has the logic to add hotseat icons and
the operations to add items to the Workspace is done in batches
which is faster and more stable. To submit everything in batches
it uses the FavoriteItemsTransaction.

This improves the design because TestWorkspaceBuilder and
HomeScreenImageTest belong to the Test layer and they should
only deal with the logic to run a test and TestWorkspaceBuilder
is the Model layer and holds all the logic to interact with the
Launcher model/data, so this separates the concern of each class.

Also, chagned the name from CellLayoutBoardBuilder to
TestWorkspaceBuilder to make it clearer.

Bug: 243440737
Bug: 235518637
Bug: 242323136
Test: atest HomeScreenImageTest
Test: atest ReorderWidgets
Change-Id: I14eef064fade153b8362537743b061958bb3071d
2022-09-12 10:54:53 -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
Sebastian Franco
8bd1283482 Add screen recording to debug test ReorderWidgets.java flakynes
Bug: 242323136
Test: atest ReorderWidgets
Change-Id: If87dc5b37029f75c4a480fbbb62e5eaca02cde4a
2022-08-17 16:52:33 -07:00
Sebastian Franco
5cba476362 Adding test for the Widgets reordering.
TAPL design chagnes at https://docs.google.com/document/d/1PdJZZIn-85-UMRFGZuqj-tJgruIWcg31lZnrb34iBTY/edit?resourcekey=0-uAZuiLCDFV9YhOtLB7wQHQ

The tests consist of a board representing the widgets on
the CellLayout a position to move the main widget (m) to
and the resulting board.

iiiii    iiiii
-----    --x--
-xxx- -> -xmx-
--m--    -----
-----    -----

Move m to 2,2.

Then whe make sure the device corresponds with the resulting
board.

I had to add the event TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Widgets.onLongClick");
on ItemLongClickListener because the tests where not expecting
a long press on a widget after is being place on the
workspace.

Also, I needed to add the option to drag a widget
to a specific point instead of the previous option
of only dragging to the workspace.

Fix: 231449779
Test: Run the test and make sure they pass.
Change-Id: I58183b7ce2ca64c999e21073cce5e0ba6e6f3a9e
2022-07-18 11:52:12 -07:00