Commit Graph

917 Commits

Author SHA1 Message Date
vadimt 2ea348ff87 Removing flake when 2 long-press events happened on single long press
There is some unknown to me logic in Launcher that sometimes duplicates
the long-press event . This causes flakes whenTAPL expects one long
press, but the actual sequence is 2 events.

That duplication logic seems to be related to race conditions is is hard
to repro. For now, just removing long-press verification. I'll start
with more deterministic events.

Bug: 147806932
Change-Id: I03841131bf8cae88011824f660f2c7b1906592f4
2020-01-16 17:10:55 -08:00
Vadim Tryshev f7b2d40347 Merge "TAPL: Verifying some interactions with system" into ub-launcher3-master 2020-01-15 22:32:13 +00:00
TreeHugger Robot 2abd13a80b Merge "Fix BaseSwipeDetector#setState() called inside another setState()" into ub-launcher3-master 2020-01-15 22:03:01 +00:00
vadimt 252d012ed0 TAPL: Verifying some interactions with system
Investigation of TAPL failures, especially flakes is complex, partially
because it’s hard to tell whether it’s Launcher who is wrong or the
system.

We need to introduce a framework that looks at Launcher interaction with
the system and reports when interactions deviate from the expected
course, and who made the first wrong step.

This is first, proof-of-concept CL.

It analyzes long-press events. We had multiple cases when long-presses
didn’t happen or happened unexpectedly.

Launcher registers the events, TAPL retrieves and compares against the
sequence of expected regular expressions. This diagnostic is used when
something fails and at the end of public methods.

Change-Id: I07aa3a027267c03422c99c73ccd8808445c55fe8
2020-01-15 13:31:18 -08:00
TreeHugger Robot 8b0e50fecf Merge "Tracing launcher package name" into ub-launcher3-master 2020-01-14 18:41:53 +00:00
vadimt cef8008bfa Tracing launcher package name
I suspect that when the test starts, launcher package may be
com.google.android.setupwizard

Bug: 145935261
Change-Id: Ibf5e9785cd73762cbf2cdc8569482d77db782897
2020-01-13 17:10:12 -08:00
TreeHugger Robot 3d76dadcd6 Merge "Recognizing running "prebuilt" launcher and manually built platform" into ub-launcher3-master 2020-01-14 00:45:46 +00:00
TreeHugger Robot d4ec31a51a Merge "TAPL: Tracing only changed part of the context for diags" into ub-launcher3-master 2020-01-13 22:39:20 +00:00
Tony Wickham 3f330429a3 Fix BaseSwipeDetector#setState() called inside another setState()
Clients of BaseSwipeDetector are required to call finishedScrolling(),
which calls setState(IDLE). An obvious place to call this is in
onDragEnd(), which itself is called from a setState(SETTLING). If the
client does this, then the SETTLING state actually clobbers the IDLE
state, leading to undefined behavior. The reason we don't see this in
practice is because we usually call finishedScrolling() after an
animation from onDragEnd() instead of calling it immediately.

To fix this, we add a simple queue such that any calls to setState()
while one is in progress have to wait and are executed in turn. This
ensures we get all the proper state callbacks and end in the correct
one.

Also fix an incorrect call in AbstractStateChangeTouchController which
was masked by this bug. We were calling setState(IDLE) in onDragStart(),
which only worked because the original setState(DRAGGING) incorrectly
clobbered this. Now we only setState(IDLE) (via finishedScrolling())
when we fully clear the state, i.e. when the interaction is finished.

Test: added testInterleavedSetState

Bug: 141939911
Change-Id: Iae630ee7101921b57a85d40646468cf19f59b674
2020-01-09 15:39:38 -08:00
TreeHugger Robot d068f1cf66 Merge "integration test for open settings menu from workspace." into ub-launcher3-master 2020-01-09 04:17:03 +00:00
vadimt 1eb46b85ec Recognizing running "prebuilt" launcher and manually built platform
In scenarios like: atest NexusLauncherOutOfProcTests against the
platform built from command line, and Launcher from the platform, we are
not failing now, and @Stability treats it as a PLATFORM_POSTSUBMIT run.

Change-Id: Ia504216d238e58b2786f3749b737dfb95a2ede96
2020-01-08 17:32:15 -08:00
Pinyao Ting 654adf657e integration test for open settings menu from workspace.
compare pid of launcher process after test execution to verify launcher isn't crashed when running in oop test.

Bug: 147235759
Change-Id: Id13c47f5c4e388cc8e95b19d099e94a2e540bf3f
Test: fun flake locally
2020-01-08 17:01:39 -08:00
Vadim Tryshev 466bf5538d Merge "Using grantRuntimePermission()" into ub-launcher3-master 2020-01-08 22:27:30 +00:00
vadimt aad54ab686 Using grantRuntimePermission()
"pm grant" is considered obsolete

Bug: 145686584
Change-Id: Ieeec76b2fdb666f89957a0a3039956bd69e9f315
2020-01-08 12:01:34 -08:00
TreeHugger Robot 3748443bfc Merge "Delete code that became dead after moving tests to robolectric" into ub-launcher3-master 2020-01-08 19:27:53 +00:00
TreeHugger Robot 2e0b8e39c7 Merge "Revert "include integration test for open settings menu from workspace"" into ub-launcher3-master 2020-01-08 18:46:01 +00:00
TreeHugger Robot d6eed66f86 Merge "Not crash when UI objects disappear during visible objects verification" into ub-launcher3-master 2020-01-08 15:27:02 +00:00
vadimt b856e48594 Not crash when UI objects disappear during visible objects verification
Bug: 146785144
Change-Id: I5ccac4871c683413c27753774adc432e5e654e27
2020-01-07 17:45:32 -08:00
Pinyao Ting cd1cc0efc1 Revert "include integration test for open settings menu from workspace"
This reverts commit e94baee999.

Reason for revert: Test failing

Change-Id: Icb5d27488618a9b70b83d7ab582082c396578700
2020-01-08 01:15:29 +00:00
vadimt b5087c45aa Delete code that became dead after moving tests to robolectric
Change-Id: I454ba9d4c8d04aae192523322a2ee8c505da5ed5
2020-01-07 12:23:57 -08:00
vadimt 2c4e3187e7 TAPL: Tracing only changed part of the context for diags
Printing the whole context stack has proven to be harder to decipher.

Change-Id: Ic11981884491fc96b939f4736ec974a1640c0304
2020-01-07 11:16:54 -08:00
TreeHugger Robot 108cc51e03 Merge "include integration test for open settings menu from workspace" into ub-launcher3-master 2020-01-06 23:22:45 +00:00
Sunny Goyal 0fd48b51ba Merge "Updating Robolectric tests" into ub-launcher3-master 2020-01-06 20:12:16 +00:00
TreeHugger Robot 59104388eb Merge "Temporary workaround for long failure messages when running from AS" into ub-launcher3-master 2020-01-06 20:10:40 +00:00
Sunny Goyal 9ae9b60043 Updating Robolectric tests
> Adding multi-thread support
> Simulating actual loader loading flow
> Moving some android tests to robolectic

Change-Id: Ie17a448f20e8a4b1f18ecc33d22054bbf9e18729
2020-01-06 11:05:42 -08:00
Dan Willemsen 26b0938f09 Fix Launcher3Tests SDK version
In a879f9c481, the ub-launcher-aosp-tapl
was switched from current to system_current. Since Launcher3Tests links
against this library, we require it to use the system stubs as well.

But I broke the check in the build system while doing some cleanup, so
we never noticed. I'm fixing the check in:
https://android-review.googlesource.com/c/platform/build/+/1156840

Bug: 143748700
Test: treehugger
Change-Id: Ifcf47b19f7ed8f907e437325b4fd6a599fcca4cf
(cherry picked from commit 981ec8b789)
2019-12-26 22:18:32 +00:00
vadimt a8523300da Temporary workaround for long failure messages when running from AS
AS installs tests in such a way that they don't get necessary
permissions; the result is a long message starting with "Failed to get
system health diags" when a test fails.

While I'm looking for a good solution, removing this annoyance.

Change-Id: I9e439c3aefb9dd365c841c98d530b9346d7ccd10
2019-12-20 19:15:20 -08:00
Pinyao Ting e94baee999 include integration test for open settings menu from workspace
Bug: 146432215
Change-Id: I2d42984dd77506385230744361ae74944cc9b3bd
2019-12-20 15:37:36 -08:00
vadimt 97d7b9024d Fixing typo
Change-Id: Ifba10c3d804f6c009b9ce40732c08ea17ee7b559
2019-12-17 14:58:10 -08:00
TreeHugger Robot 45657afdde Merge "Adding diagnostics for failing click-to-home" into ub-launcher3-master 2019-12-16 22:49:21 +00:00
TreeHugger Robot c9a907bec1 Merge "Removing temporary workarounds to make tests pass on Cuttlefish" into ub-launcher3-master 2019-12-16 22:37:09 +00:00
TreeHugger Robot 0f58b63445 Merge "Diagnosing visible windows' packages for Background mode" into ub-launcher3-master 2019-12-16 22:36:48 +00:00
TreeHugger Robot 7d8901689c Merge "Improving navigation mode switch rule and around" into ub-launcher3-master 2019-12-16 22:36:42 +00:00
vadimt 44e697b0a3 Adding diagnostics for failing click-to-home
Bug: 133010698
Change-Id: Id887543f65812bb5607043a1cfcb2e95cf97ccb5
2019-12-16 13:38:27 -08:00
Vadim Tryshev f4b5bcac43 Merge "Starting swipe-to-all-apps outside of areas triggering long-press" into ub-launcher3-master 2019-12-13 18:50:22 +00:00
vadimt 08eca2fa2e Removing temporary workarounds to make tests pass on Cuttlefish
Bug: 136278866
Change-Id: Ie537a578bb871921c0cbea1f197261e703de98f5
2019-12-12 18:15:48 -08:00
vadimt 03cd58e575 Diagnosing visible windows' packages for Background mode
Change-Id: I3caeef4cd890500585f033024b1b6c3521b9e39d
2019-12-12 18:07:42 -08:00
vadimt a45ee97074 Recycling accessibility event as the docs require
Change-Id: I94a2ea7ab93690d0216110b5f77f0116177788a7
2019-12-12 17:43:38 -08:00
vadimt f0c80528ab Starting swipe-to-all-apps outside of areas triggering long-press
I suspect that some tests using TAPL run under pressure (mem or CPU,
created either intentionally or as a result of a leak somewhere)
where test process may generate a pause between DOWN and MOVE events
enough to be recognized as a long tap, which opens a context menu
instead of swiping.

While the clean solution is b/140252325, this is a workaround.

Bug: 144853809
Change-Id: I135eaee608270b7e60bb072cb360632763cbe5c5
2019-12-12 16:27:25 -08:00
vadimt 2eb48498b4 Improving navigation mode switch rule and around
Logging assertion failures.
Modifying waits for condition to avoid timing out the whole test if the
iteration takes too long in favor of failing with an actionable diag.

Bug: 145985438
Change-Id: Ie32d93e1548ce6ec64c38449eb1be1287ff9cf56
2019-12-12 15:10:52 -08:00
vadimt 526c630500 Simplify diagnosing of the context menu being present when not expected
Change-Id: I3550a724665f908ef70570e2e151c53fc7fa1844
2019-12-11 18:09:39 -08:00
TreeHugger Robot 98833d525c Merge "Updating some non-final static objects" into ub-launcher3-master 2019-12-11 22:07:53 +00:00
TreeHugger Robot 7d2f42d97a Merge "Moving logging Launcher and platform versions before matching" into ub-launcher3-master 2019-12-11 21:30:35 +00:00
Sunny Goyal 73b5a27b14 Updating some non-final static objects
Updating various static objects to use a standard pattern so that
it is easier to track and cleanup those objects

Bug: 141376165
Change-Id: Ia539cbfa338d544dddad771c5027b6748762768b
2019-12-11 13:22:58 -08:00
TreeHugger Robot 4f37a5e268 Merge "Removing static instances of UserManagerCompat and AppWidgetManager" into ub-launcher3-master 2019-12-11 18:41:04 +00:00
Sunny Goyal 337c81f664 Removing static instances of UserManagerCompat and AppWidgetManager
> Changing the lifecycle to follow other static objects in Launcher
> Removing compat interface and inlining everything to helpers

Bug: 141376165
Change-Id: I82bd5db1969101de9a7eac77f32728d70195bb35
2019-12-11 10:03:19 -08:00
vadimt 61e285245e Moving logging Launcher and platform versions before matching
I suspect that sometimes APIs return versions that are different from
ones in the bugreport. We want to see them before possible non-match
failures.

Bug: 145935261
Change-Id: Ia1a9208de111368245eac9147ae4a189db823105
2019-12-09 18:15:33 -08:00
vadimt bdaa179b92 Consistently checking state change messages
Checking for events whenever Launcher sends them.
Checking for correct events (final events, not for events from
intermediate state changes).

This should simplify diagnosing of bugs involving TAPL.
This is also supposed to fix Fallback overview tests.

Bug: 143488140
Change-Id: If053ed808ec71bf2b652ab680be5bdfe9ff8cbb9
2019-12-09 12:33:39 -08:00
Sunny Goyal 4b5b0eb60d Moving some tests to robolectric
> Adding support for simulating model load

Bug: 130562632
Change-Id: I1de8c0abe2e74d4e7e47e18914316c339920609a
2019-12-09 11:17:12 -08:00
Tony Wickham 8a50a6d858 Send home intent after reaching 3P launcher on swipe up
Also keep the 3P launcher's alpha at 0 during the gesture, and
don't send the home intent if user touches during the transition.

Bug: 139682945
Change-Id: Ie758f0b337bb173b34f5585ec1915b7ea1145094
2019-12-05 14:40:13 -08:00