Commit Graph

1293 Commits

Author SHA1 Message Date
Sebastián Franco
db982003b2 Merge "Adding unit test to ReorderAlgorithm" into udc-dev 2023-05-03 20:13:15 +00: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
Sunny Goyal
9ef41413e0 Changing GridMigrationTask to use ModelDbController directly
instead of using content uris

Bug: 277345535
Test: Updated tests
Flag: Presubmit
Change-Id: Ib62db3334c01d9e7d27ae7b02ea703d046e2bcaa
2023-05-03 08:54:14 -07:00
Fengjiang Li
5a36c17a32 [1/n] Launcher Startup Latency: add StartupLatencyLogger to launcher3 and log startup latency
More details at "Log Startup Latency" section in go/launcher-startup-latency

Test: tested on phone, foldable and tablet, print latency logs in logcat
Bug: 278092752
Change-Id: Ibf269b0ecd6007d29b95e36f65ab6f02c45deb3a
2023-05-02 17:08:05 -07:00
Schneider Victor-tulias
8c1bffb24f Merge "Remove unused debug logs" into udc-dev 2023-04-27 17:44:42 +00:00
Vinit Nayak
af55572713 Merge "Add logs for PackageUpdatedTask" into udc-dev 2023-04-26 23:05:42 +00:00
Vinit Nayak
6106ae9ac7 Add logs for PackageUpdatedTask
* That's the bit that updates new packages for work profile,
at least from command line.
* There is variability in how long it could take work profile
apps to show up, from 2-8 seconds.

Bug: 243688989
Change-Id: I710befc5f17b4a16bff523eb03f1e88975cafd43
2023-04-26 13:21:57 -07:00
Schneider Victor-tulias
fff7cef9f1 Remove unused debug logs
Removing debug logs for bugs that have already been closed. These logs are filling up the logcat buffer and impeding in other test investigations.

Flag: not needed
Test: Tapl tests
Bug: 260260325
Change-Id: I4d69b904f2ea79d758cf6bef7d90d172f2eb2a91
2023-04-25 11:00:37 -07:00
Vadim Tryshev
ff056355c2 Merge "Saving bugreport for the first failed test." into udc-dev 2023-04-25 04:04:11 +00:00
Andrew Cole
172cf0f43e Merge "Reverting isTextClippedVerticallyTest" into udc-dev 2023-04-25 03:34:37 +00:00
Andrew Cole
47e1423584 Reverting isTextClippedVerticallyTest
Reverting the isTextClippedVerticallyTest Unit test becase it is causing errors in post submit.

Test: Run isTextClippedVerticallyTest
Bug: 279464742
Change-Id: I766c867d07f0a911fd4017c9505e68638a9a3643
2023-04-24 15:32:35 -07:00
vadimt
83e7b8dd07 Saving bugreport for the first failed test.
When a test fails, we need bugreport, but it's not guaranteed, as per b/279484565.

Test: presubmit
Bug: 273319213
Change-Id: If71aef768873c2ef57b11f32d628abf97bd76a5a
2023-04-24 22:19:02 +00:00
Jagrut Desai
396002dcee Merge "Tracing for AddConfigWidgetTest" into udc-dev 2023-04-24 22:11:19 +00:00
Jagrut Desai
0dc1b79fdf Tracing for AddConfigWidgetTest
Test: none
Bug: 276794291
Flag: not needed
Change-Id: I56c4279cf7af2ec704aec8950a3ba7781f8c6b12
2023-04-24 13:12:41 -07:00
Vadim Tryshev
ca83c69dc4 Merge "Making it clear that a test sees the keyguard for the first time." into udc-dev 2023-04-21 19:16:43 +00:00
Andrew Cole
d59c600411 Merge "Screen recording flakey test" into udc-dev 2023-04-21 17:51:56 +00:00
Andrew Cole
0d775d3508 Merge "Unit testing ButtonDropTarget" into udc-dev 2023-04-20 23:35:49 +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
Andrew Cole
44898c3db4 Unit testing ButtonDropTarget
Originally there was a bug in a method (isTextClippedVertically) in ButtonDropTarget. While attempting to write a unit test it became necessary to refactor ButtonDropTarget and DeleteDropTarget to decouple them from their dependency on launcher in order to allow for a unit test to be written

The pattern we are introducing here is to decouple Launcher from a controller, in order to facilitate easier testing.
Instead of calling Launcher.getLauncher() we call the method through ActivityContext, which has a testing wrapper already defined. Here is a diagram that explains the old and new pattern

Design Pattern: https://screenshot.googleplex.com/7apiE2DaGDrFzy9.png

Test: isTextClippedVerticallyTest
Bug: b/274402490

Change-Id: I1f3003d0b62dddbceb6e492b15aa5d7352d3a293
2023-04-20 11:22:27 -07:00
Sunny Goyal
ce953a36ec Moving ModelDbController from LauncehrProvider to LauncherModel
Migrating some of the class to use the controller directly, will
update the remaining calls in follow up cls

Bug: 277345535
Test: Presubmit
Change-Id: I8edc7c43665f94702ac64bd92932d6c94cb544a4
2023-04-14 14:13:17 -07:00
Andrew Cole
89aea61bc4 Screen recording flakey test
Adding back the screen recording on the test to see more information about what is failing

Test: Manual
Bug: b/258071914
Change-Id: I6114c66f3fc78e9713cd9f13fd8d8008d9921a32
2023-04-14 20:21:01 +00:00
Sunny Goyal
348e518b2c Merge "Using a runtime generated layout for tests instead of defining xml" into udc-dev 2023-04-14 18:12:57 +00:00
Sebastián Franco
df812dfd91 Merge "Parsing test boards from text files to be able to add more and bigger tests" into udc-dev 2023-04-13 20:32:34 +00: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
Sunny Goyal
ab2f808196 Using a runtime generated layout for tests instead of defining xml
This allows support for easily setting up default layouts

Bug: 277345535
Test: Presubmit
Flag: N/A
Change-Id: I1c089d60ac3f8add8d7e1060d343e04d30afe094
2023-04-12 22:54:14 +00:00
Sunny Goyal
eb27546cc3 Removing remaining code around ENABLE_DATABASE_RESTORE
ENABLE_DATABASE_RESTORE feature is already removed
Also migrating some tests from BackupRestoreTest to RestoreDbTaskTest

Bug: 270392706
Test: Presubmit
Flag: N/A
Change-Id: I71822bbc2232008b3d2b4b9fbed0db5d889591e4
2023-04-12 15:52:35 -07:00
Sunny Goyal
1ae46ca868 Moving all DB management logic from LauncherProvider into a separate class
This would make it easier to move the controller to LauncherModel

Bug: 277345535
Test: Presubmit
Flag: N/A
Change-Id: I4d044cf41361f400968ef65e18de5d3976fcdec7
2023-04-11 11:46:40 -07:00
Sunny Goyal
84b48d8deb Removing support for adding legacy shortcuts.
All existing legacy shortcuts will be migrated one-time to deep shortcuts
This shortcuts are pinned under the Launcher package, with custom badging

Bug: 275875209
Test: Updated unit tests
Flag: N/A
Change-Id: I7da001f724776ad8d6c807517b7e4e259de626c2
2023-04-10 12:28:52 -07:00
TreeHugger Robot
643253d433 Merge "Moving DatabaseHelper to it's own class outside of Launcher provider" into udc-dev 2023-04-10 18:33:39 +00:00
Sunny Goyal
ba2795827b Moving DatabaseHelper to it's own class outside of Launcher provider
Bug: 277345535
Test: Presubmit
Flag: N/A
Change-Id: Ib8c94ceb954172dc27e357be2face06d50d399dd
2023-04-10 09:15:18 -07:00
Sam Saccone
a61ac589a3 Merge "Failing all e2e tests after seeing a lock screen without additional checks for the lock screen" into udc-dev 2023-04-08 22:21:10 +00: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
Charlie Anderson
471b88269f Prevents cropping of shortcuts in the app popup menu by limiting rows to available screen space.
- Limit the number of shortcut rows shown to what will fit the screen.
 - Fix drag testDragShortcut so that it works for all screen sizes.
 - Prevent cropping and misalignment of shortcut text.

Bug: 247880037
Fixes: 275115239
Test: locally on different devices, and with Display Size set to different sizes
Change-Id: I18b27ec302c34d1d801171ab18c64169a9f252ee
2023-04-06 15:23:38 -04:00
TreeHugger Robot
75f7bbc150 Merge "Allow grids to specify if we should start align taskbar in 3 button nav." into tm-qpr-dev am: 65ac592f40 am: a2b770b484
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22361600

Change-Id: I41eea8cf3fa15c9c5c3f3184f2ba75318332f623
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-05 22:36:14 +00:00
Sunny Goyal
8382546a11 Merge "Removing support for legacy shortcuts from default layouts" into udc-dev 2023-04-05 22:26:36 +00:00
Andrew Cole
6598fab10c Merge "Improving a flakey uninstall from allapps test." into udc-dev 2023-04-05 20:27:10 +00:00
Sunny Goyal
afaa8f0bfe Removing support for legacy shortcuts from default layouts
Launcher will only allow deep shortcuts to be pinned on homescreen.

Bug: 275875209
Test: Updated tests
Flag: N/A
Change-Id: I4f2674deb9cd81dd07d5d537f35a51b030a183da
2023-04-05 20:20:34 +00:00
Jon Miranda
04f051045c Allow grids to specify if we should start align taskbar in 3 button
nav.

Bug: 259712417
Test: check layout on tablet
      check layout on multi_display devices

Change-Id: I282f51e5d76a30e9ad9d8c52d03d4853e965d65a
2023-04-05 10:29:51 -07:00
Andrew Cole
78e1461748 Improving a flakey uninstall from allapps test.
Previously the test froze the all apps list before the uninstall action, but what we are testing here is that the all apps list does change. Also included is a small refactor to use the same wait method for this test and a second test.

Test: Ran Locally on Device
Bug: b/258071914
Change-Id: Ic18be39130fbd7b7e1214d6fc60c1afa30ddf078
2023-04-05 10:16:00 -07:00
Sunny Goyal
6b543872fb Merge "Removing unnecessary device sumaltion code" into tm-qpr-dev am: 08a13d6aae am: e2d73bf57d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22432108

Change-Id: I007c3bcd9a5d5dd8c986efc089420f73f7bad18f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-04 17:50:24 +00:00
TreeHugger Robot
0770b619ed Merge "Ensuring that badge override is respected even if component name is set on the Shortcut" into udc-dev 2023-04-04 00:40:14 +00:00
Sunny Goyal
076e04bcc2 Removing unnecessary device sumaltion code
Bug: 276774148
Test: Verified on device
Change-Id: Icb8c2e7649e5b0e107af184b63f7e30f2df717bd
2023-04-03 12:38:52 -07:00
Sunny Goyal
899bf30fe8 Ensuring that badge override is respected even if component name
is set on the Shortcut

Bug: 276319271
Test: atest IconCacheTest
Flag: N/A
Change-Id: I33802ecd23485ba092f842ec3c3d58e2fc286f92
2023-04-03 08:31:02 -07:00
vadimt
59cc1714ce Demoting WorkProfileTest#testEdu from presubmit due to high flakiness
Test: presubmit
Bug: 243688989
Change-Id: Ib477e9f749a6f7117008d65316f32080c719167c
2023-03-30 17:53:52 -07:00
vadimt
a2918038fc Demoting WorkProfileTest#workTabExists from presubmit due to high flakiness
Test: presubmit
Bug: 243688989
Change-Id: I2edbd94a79d8f66e006ce0087bf4ab617e6ba041
2023-03-30 10:45:01 -07:00
Schneider Victor-tulias
f8f602d76c Merge "Fix TwoPanelWorkspaceTests" into tm-qpr-dev am: 90259a6db4 am: d8e5795131
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22185922

Change-Id: Ic5d6ce2a870f19c960baab3af8abfb1faee248f1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-30 17:16:22 +00:00
Vinit Nayak
e6d86e20aa Consolidate WorkProfileTest "@After" methods
* There were two separate methods, which can run in
any order. Consolidate to reduce variability

Bug: 243688989
Change-Id: Ic924aa8a5d75505aecf6c830c63a85a0d2028d83
2023-03-29 18:21:45 +00:00
Schneider Victor-tulias
7cd0ae3f73 Fix TwoPanelWorkspaceTests
- Marking the hotseat long press edu as seen on setup to allow the popup menu to be shown immediately in tests
- Recording onWorkspaceItemLongClick on prediction item long click

Flag: not needed
Fixes: 273239675
Test: TwoPanelWorkspaceTest
Change-Id: I76354fd2e3adde11b2a428374fa9c8855ce2ece9
2023-03-27 14:24:35 -07:00
Hyunyoung Song
42dcf69c2f Merge "Icon should not disappear on drag and drop" into tm-qpr-dev am: 7eae6a4ce1 am: 739dcca38a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22255567

Change-Id: I64f193bd8d5d7a47cc686f1e4759161d6ad6f5e7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-26 08:24:39 +00:00
Hyunyoung Song
7eae6a4ce1 Merge "Icon should not disappear on drag and drop" into tm-qpr-dev 2023-03-26 07:22:55 +00:00