Commit Graph

182 Commits

Author SHA1 Message Date
Shamali Patwa
45b5acef28 Merge "Cleanup widgetsModel and add tests" into main 2024-07-17 22:55:01 +00:00
Andrew Cole
940917b92e Merge "Test Week - Deleting NexusTestInformationHandler" into main 2024-07-17 22:33:47 +00:00
Andrew Cole
f0bdb71e38 Merge "Test Week - FolderAccessibilityHelperTest" into main 2024-07-17 20:16:39 +00:00
Fengjiang Li
a92b80f357 Merge "[Test Week] Move ViewCacheTest.kt to multivalentTests folder" into main 2024-07-17 16:55:38 +00:00
Andrew Cole
6ce5c66356 Test Week - FolderAccessibilityHelperTest
Adding unit tests for FolderAccessibilityHelper. In order to write these tests we have also included a refactor of DragAndDropAccessibilityDelegate to get mDragLayer and the accessibility delegate from ActivityContext instead of Launcher. This allows us to pull that from test context in ActivityContextWrapper during testing.

* Tests 1 class previously untested
* Tests 3 methods
* Includes 1 class refactor

Bug: 353303621
Test: FolderAccessibilityHelperTest
Flag: TEST_ONLY

Change-Id: I8d13113fc09d3ee902faecc426deb80bcbae0b0d
2024-07-17 09:48:30 -07:00
Shamali P
3ae39c72de Cleanup widgetsModel and add tests
1. Removes unused method `getAllWidgetComponentsWithoutShortcuts`
2. Exposes widgets either as component map or package item map - to
eliminate the duplicate logic around widget sections.
3. Add tests that validate that each package is unique - to help
cover the redirect issue seen in past.
4. In follow up cls, other methods that deal with picker specific data
types like WidgetsListBaseEntry will also be moved out - leaving the
model to only be responsible for providing all widgets map or widgets
by package.

Bug: 341611976
Flag: EXEMPT BUGFIX
Test: Unit test
Change-Id: Ife70874d312b51c66025a6ec678480f2b5c41793
2024-07-17 14:29:31 +00:00
Treehugger Robot
c2a36a6fcd Merge "Add Repository for RecentOrientedState and DeviceProfile" into main 2024-07-17 12:25:09 +00:00
Alex Chau
5837a4628c Add Repository for RecentOrientedState and DeviceProfile
- DeviceProfile have java fields that cannot be mocked, nor can be freely instantiated, so I've to use FakeInvariantDeviceProfileTest to give me some predefined DeviceProfile for testing

Bug: 343101424
Test: RecentsOrientedStateRepositoryTest
Test: RecentsDeviceProfileRepositoryTest
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: Iaa34ef60a418eb336859d260f5808b263de6b4f7
2024-07-17 11:29:20 +01:00
Fengjiang Li
7f81733666 Merge "[Test Week] Add RunnableListTest" into main 2024-07-17 07:10:24 +00:00
Treehugger Robot
52f7fc5ef6 Merge "Unit tests for ListenableHostView" into main 2024-07-17 01:17:57 +00:00
Stefan Andonian
3e28e9c829 Merge "[Test Week] Unit test for WidgetAddFlowHandlerTest." into main 2024-07-16 23:25:57 +00:00
Fengjiang Li
9569f54008 [Test Week] Add RunnableListTest
Number of new tested methods: 5

Bug: 353303621
Test: This is the unit test
Flag: NONE - unit test
Change-Id: I546a775530cdf61424f1047e81e79c28fa7c63e4
2024-07-16 15:26:36 -07:00
Stefan Andonian
2e1bb929ba Unit tests for ListenableHostView
3 public methods.

Bug: 353303621
Test: unit test CL.
Flag: EXEMPT unit test
Change-Id: If5e3b4f8e6f2fa2c2e44907a1a8080215f231ca2
2024-07-16 21:03:56 +00:00
Stefan Andonian
35b584d0ef [Test Week] Unit test for WidgetAddFlowHandlerTest.
8 public methods covered.

Bug: 353303621
Test: Unit Test
Flag: EXEMPT unit test
Change-Id: I5dd20de33b64de561ee8845beaa513b4e08c3a31
2024-07-16 20:58:39 +00:00
Stefan Andonian
19c5f7ae71 [Test Week] Unit test for WidgetManagerHelperTest.
6 public methods covered.

Bug: 353303621
Test: Unit Test
Flag: EXEMPT unit test
Change-Id: I549d97f5b57f0e6e9af44bd1695d94ebfa0538f2
2024-07-16 20:58:11 +00:00
Fengjiang Li
6cd7630504 [Test Week] Move ViewCacheTest.kt to multivalentTests folder
Bug: 353303621
Test: This is the unit test
Flag: NONE - unit test
Change-Id: Ie969e9bffecf61bbcfd7b2132ef7a5df1d97cbed
2024-07-16 11:36:31 -07:00
Sihua Ma
7098ba260f Add test for LauncherWidgetHolder
Number of new tested methods: 8

Test: atest NexusLauncherRoboTests:LauncherWidgetHolderTest
Test: SysUI studio
Flag: TEST_ONLY
Bug: 353303621
Change-Id: I8751c8de8d719e567775368d988794b2d7abc37e
2024-07-15 22:51:04 +00:00
Andrew Cole
d798e6d1f9 Test Week - Deleting NexusTestInformationHandler
NexusTestInformationHandler only relied on one boolean switch that is not currently used so I am deleting it.

Bug: 353303621
Test: TAPL
Flag: TEST_ONLY
Change-Id: I6181d47561b318d1eb1bd632d4ae042e126cfdb9
2024-07-15 11:57:47 -07:00
Treehugger Robot
21b2215968 Merge "Add debug logs to print stack trace for Private space flaky test." into main 2024-07-11 21:48:41 +00:00
Anushree Ganjam
f828683fa8 Add debug logs to print stack trace for Private space flaky test.
From the failure test videos, it looks like scrollToTop gets called https://b.corp.google.com/issues/339737008#comment15.

Bug: 339737008
Test: Manual
Flag: TEST_ONLY
Change-Id: I61a95ff45fa4409f8f1b243ac435002556a16677
2024-07-10 13:44:11 -07:00
Sebastian Franco
224f67a046 Moving ReorderWidgetsTest to an integration test instead of E2E
Flag: TEST_ONLY
Test: IntegrationReorderWidgetsTest
Bug: 324261526
Fix: 343761044

Change-Id: I9bfe8b587e1024260ddeeb48157c3d204f2d58f2
2024-07-10 04:20:41 +00:00
Willie Koomson
caf7065ef4 Cleanup obsolete generated preview tests
Remove tests that no longer run because the flag is always enabled.

Bug: 343764554
Bug: 336821272
Test: N/A
Flag: android.appwidget.flags.generated_previews
Change-Id: I106579771c2301cdac2ff1a17008c9faa1a1b0e3
2024-06-26 19:12:43 +00:00
Uwais Ashraf
c902df4e41 Enable currently functional multivalent tests
Flag: EXEMPT test-only
Bug: 325088619
Bug: 325088638
Bug: 325088328
Test: Presubmit
Test: Gradle robolectric run
Change-Id: I20e77a401ed98c97168bf9c752eacc93c3c545dd
2024-06-22 22:14:30 +00:00
Brian Isganitis
d0261a8e57 Extract RoboApplication object caching to Launcher3 interface.
Multivalent tests in Launcher3 can use the interface to override
MainThreadInitializedObject instances.

Test: n/a
Flag: TEST_ONLY
Bug: 230027385
Change-Id: I9c7c4fd004ca573a003fb11cd0a19a400e95afe4
2024-06-18 18:36:53 -04:00
Sihua Ma
ea913b3dee Merge "Migrate responsive tests to multivalent" into main 2024-06-13 17:13:06 +00:00
Sihua Ma
73c766d75d Migrate responsive tests to multivalent
Test: atest NexusLauncherRoboTests
Test: SysUI studio
Flag: TEST_ONLY
Fix: 325088640
Change-Id: I32cce09ff7ef070b6c86b6440723006b5cb503cf
2024-06-13 09:48:09 +00:00
Uwais Ashraf
eecadb0432 Enable UtilitiesKtTest for multivalent. Remove test resource
Fix: 325088427
Test: UtilitiesKtTest in studio and presubmit
Flag: EXEMPT test-only
Change-Id: I71b77c4633b1075f643ed479f8224f9b80811f54
2024-06-11 22:38:34 +00:00
Sihua Ma
c22a8e7495 Merge "Migrate GeneratedPreviewTest to multivalent" into main 2024-06-10 20:57:00 +00:00
Sihua Ma
de5ef62967 Migrate GeneratedPreviewTest to multivalent
Test: atest NexusLauncherRoboTests
Test: SysUI studio
Fix: 325088369
Flag: TEST_ONLY
Change-Id: I2c88a357c8ac5fb0171a70e850be25e8fb11de33
2024-06-10 16:49:47 +00:00
Uwais Ashraf
8e537d1ee5 Merge "Move AppFilterTest to Deviceless" into main 2024-06-10 08:22:00 +00:00
Andrew Cole
8a4af691c8 Move AppFilterTest to Deviceless
Bug: 297950111
Test: atest NexusLauncherRoboTests
Test: SysUI studio
Flag: TEST_ONLY
Change-Id: I9e12a23966017aa2136f92e84eebb216ed8525cf
2024-06-07 15:38:17 -07:00
Alex Chau
0d934c47e5 Add test for UserBadgeDrawable alpha handling
Fix: 316576459
Test: UserBadgeDrawableTest
Flag: EXEMPT bugfix
Change-Id: I3819855f8cac24176ea734bd6a0ac7bffd17e900
2024-06-07 11:39:21 +01:00
Treehugger Robot
e8638f4eb2 Merge "Run UiThreadTest in LauncherMultivalentJUnit" into main 2024-06-05 17:02:46 +00:00
Andrew Cole
2c3ebd71f2 Merge "First Unit Tests for Utilities.java" into main 2024-06-04 21:28:50 +00:00
Treehugger Robot
fb133bdb69 Merge "Allow DeviceProfile tests to run on TreeHugger Robolectric device" into main 2024-06-04 12:28:42 +00:00
Uwais Ashraf
801563328a Allow DeviceProfile tests to run on TreeHugger Robolectric device
Bug: 325088842
Test: Presubmit passes
Flag: EXEMPT test-only
Change-Id: Id2856b2016b2e1ba467c7b8e830631f5253d6b8c
2024-06-04 11:03:34 +00:00
Schneider Victor-tulias
38b9e1438e Merge "Clean up unused debug logs for b/319168409" into main 2024-06-03 20:31:42 +00:00
Schneider Victor-tulias
43592a83c8 Clean up unused debug logs for b/319168409
Flag: NONE removing debug logs
Fixes: 319168409
Test: TaplDragTest#testDragAppIcon
Change-Id: I73208b042248df04281d52eaf3ed6832abbfc144
2024-06-03 12:05:40 -04:00
Uwais Ashraf
050ff39fe2 Revert flaky FolderNameProviderTest
Bug: 325088328
Test: Presubmit passes
Flag: EXEMPT test-only
Change-Id: I22c0bfdea32f552ffdb5dacc34038f7b1c668762
2024-06-03 15:35:13 +00:00
Shamali Patwa
8e7613e4c7 Fix test failure in post submit
Bug: 343937933
Change-Id: Ie989e4ce4f098a225873d13de9c6913933e5628e
Test: Unit test fix
Flag: None test fix
2024-05-31 21:59:41 +00:00
Andrew Cole
967dd54595 First Unit Tests for Utilities.java
Writing some initial unit tests for Utilities.java to get others started so they can easily add to the party.

Bug: 297950111
Test: Self
Flag: TEST_ONLY
Change-Id: I3323e6483790e2c2fbbd5c8db0281802abf0749b
2024-05-31 14:50:48 -07:00
Jagrut Desai
98eac2c1b2 Merge "Removing TWO_NEXUS_LAUNCHER_ACTIVITY_WHILE_UNLOCKING" into main 2024-05-31 20:40:54 +00:00
Jagrut Desai
1eb576905a Removing TWO_NEXUS_LAUNCHER_ACTIVITY_WHILE_UNLOCKING
Test: Presubmit
Bug: 273347463
Flag: TEST_ONLY
Change-Id: Idcd49b857e6f6c2832211306c90a19c88fb2a224
2024-05-31 11:01:50 -07:00
Sihua Ma
3b2a136272 Run UiThreadTest in LauncherMultivalentJUnit
Additionally migrating DisplayControllerTest to multivalent

Flag: TEST_ONLY
Test: atest NexusLauncherRoboTests
Test: SysUI studio
Change-Id: I9ff89218947b32f79b39bb0e6dd4beabec3b7369
2024-05-30 23:11:29 +00:00
Tracy Zhou
55308cadcf Merge "Support trackpad tapl tests in 3-button mode" into main 2024-05-30 17:59:13 +00:00
Shamali Patwa
c4c554139f Merge "Scale down the widget previews on similar scale as the spring load scale" into main 2024-05-30 14:58:41 +00:00
Uwais Ashraf
9d4f5d1cc9 Merge "Replace verifyZeroInteractions with verifyNoMoreInteractions" into main 2024-05-30 10:10:13 +00:00
Tracy Zhou
acb4a3d1e8 Support trackpad tapl tests in 3-button mode
Currently we have logic to only enable input monitor when a trackpad is connected. Tapl tests need to have infrastructure to override that logic

Bug: 335146977
Test: presubmit
Change-Id: Ib7f80c828760f8b5abd7ed2788b246e47fca6e34
2024-05-29 21:58:20 -07:00
Shamali P
3dabf391f2 Scale down the widget previews on similar scale as the spring load scale
Currently entire workspace scales down, but the original view sticks
to user's finger at same size as before. This makes the view look larger
obstructing the view of workspace behind it - specifically, when the
widgets are of larger size.

Additionally, with this scaling change, the preview images that aren't
of same aspect ratio don't break the transition to final widget as
before.

Bug: 338290585
Test: Unit test
Flag: None bugfix
Change-Id: I1d1818e60506898c7b28074f01cee91282032a94
2024-05-29 22:38:22 +00:00
Sihua Ma
9d093d5b57 Replace verifyZeroInteractions with verifyNoMoreInteractions
Also migrating LockedUserStateTest and AbstractFloatingViewHelperTest
to multivalent

Test: atest NexusLauncherRoboTests
Test: SysUI studio
Flag: TEST_ONLY
Bug: 297950111
Change-Id: Ic476de791109e7892c86bf5ae77727fc0506f0b9
2024-05-29 22:03:43 +00:00