Commit Graph

6 Commits

Author SHA1 Message Date
Sebastian Franco
ddd0450f6b Remove odd screen ids when isTwoPanels is true
We where adding more CellLayouts but they where later
removed by removeExtraEmptyScreenDelayed but when rotated
the pagination animation is created before they are removed.

With this change the extra CellLayouts won't be added in the first
place.

Fix: 291822492
Test: RoerderWidgets
Test: FoldableItemsIntegrity
Change-Id: I561d2ce961a7ecc50f7a8c99c4acc44262b2e211
2023-08-18 12:51:00 -07: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
45b39b50e5 Adding unit test to ReorderAlgorithm
Adding 100 different test cases for the ReorderAlgorithm.
The test cases are randomly generated using generateRandomTestCase()
the boards are generated once and then written in the file
reorder_algorithm_test_cases. I will leave the code to generate
the boards in the Test even though is not used anymore in case
we need to generate more boards later on.

Also, I found that the ReorderAlgorithm was not deterministic,
meaning that it could generate two different results with the same
inputs (views positions and view being drag positions), because
it was traversing a map whose has was the object id which is
random. So I sort the views before traversing them.

Bug: 229292911
Test: atest ReorderAlgorithmUnitTestCase

Change-Id: I196eb8f1dafcb57d5259969268c458129ae4f46b
2023-05-03 11:22:09 -06:00
Sebastian Franco
e7c3d3d4ce Parsing test boards from text files to be able to add more and bigger tests
It also adds an assets folder inside of Launcher3 tests.

It also fixes a bug in fullReorder.

Test: atest ReorderWidgets
Flag: none
Bug: 229292911
Change-Id: I7dadd42a3057d353326691163bb7db71a2e9dcc4
2023-04-13 17:14:51 +00: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
48c7f8e035 Adding test to make sure the icons seen when unfolded are the same when folded
Bug: 188081026
Test: atest FoldableItemsIntegrity
Change-Id: I7e09c03fccb89b1d218bf196433b2fe4ad09d8e0
2023-02-01 13:22:33 -08:00