Commit Graph

2518 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
c15679d512 Merge "[1/n] Launcher Startup Latency: add StartupLatencyLogger to launcher3 and log startup latency" into udc-dev 2023-05-03 03:18:46 +00: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
Winson Chung
c8ad4f7f43 Wait for shell drop target to be ready for handling drags in tests
- Wait for the shell drop target to be made visible and drawn before
  attempting to continue with the drag gesture

Bug: 234653212
Test: atest NexusLauncherTests

Change-Id: Ida851343873b51288460f25bba062f29019005d4
2023-05-02 05:29:36 +00: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
Vadim Tryshev
2b24e53531 Merge "Better diagnose Launcher state when there is an open folder." into udc-dev 2023-04-21 00:39:15 +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
vadimt
9f49e5f33f Better diagnose Launcher state when there is an open folder.
Without this change, the diag is:
visible state is LaunchedApp (active app: com.google.android.apps.nexuslauncher)

https://android-build.corp.google.com/test_investigate/?testResultId=TR37728586113816784&invocationId=I13000010147719553&tab=trace

Test: presubmit
Bug: 187761685
Change-Id: Ia2425a09408d7e1a9c22d0a65fc4ab31cc793a46
2023-04-20 13:59:39 -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
Sebastián Franco
051a1e35c8 Merge "Make functions private to keep TAPL design consistent" into udc-dev 2023-04-19 23:45:14 +00:00
Brian Isganitis
91b0e2d6d1 Merge "Properly compute scroll for Taskbar All Apps." into udc-dev 2023-04-19 14:36:21 +00:00
Sebastian Franco
c42520965f Make functions private to keep TAPL design consistent
Bug: 266116487
Test: compiles
Change-Id: I22b612e4bc1a7424af3702474b709426fcfcb6ef
2023-04-18 13:43:10 -07:00
Brian Isganitis
01be7eeb57 Properly compute scroll for Taskbar All Apps.
It was hooked up to Launcher All Apps scroll, which is a separate
instance from Taskbar.

Test: atest WMShellFlickerTests
Fix: 270770472
Change-Id: I14b11c8b5f1143886dd5976a12bba9e4ee66aa96
2023-04-17 18:19:54 +00: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
f8e0e7270e Merge "Removing support for adding legacy shortcuts." into udc-dev 2023-04-11 14:39:53 +00:00
Vadim Tryshev
f1fe64eb95 Merge "Not spamming logs with "Hierarchy before swiping up to home"" into udc-dev 2023-04-11 02:04:50 +00:00
vadimt
22b1daea5e Not spamming logs with "Hierarchy before swiping up to home"
Bug: 260260325
Test: presubmit
Change-Id: I74e0729ae62656a235eb71e443a2ddf9a6cae3f9
2023-04-10 15:19:48 -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
TreeHugger Robot
a2b770b484 Merge "Allow grids to specify if we should start align taskbar in 3 button nav." into tm-qpr-dev am: 65ac592f40
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22361600

Change-Id: I71c7f33286ccfa770f87b812c8ec27fa4ecb25ed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-05 22:06:49 +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