Commit Graph

1257 Commits

Author SHA1 Message Date
Vinit Nayak 916456bb5f Cleanup code related to ag/11035582
Fixes: 154235554
Change-Id: I114d1e1b9e446e15a774a5a51bdf988070091523
2020-04-16 14:16:56 -07:00
Hyunyoung Song 19a6022ae4 Merging from ub-launcher3-rvc-dev @ build 6396980
Bug:150504032
Test: manual, presubmit on the source branch
x20/teams/android-launcher/merge/ub-launcher3-rvc-dev_rvc-dev_6396980.html

Change-Id: If639a1565ce5c4af36d7bce3701b0d1d77fedec0
2020-04-15 15:49:20 -07:00
vadimt cf275c1bd7 Choosing better points to output "start" events for TAPL
Now doing this before branching points, thus avoiding flakes when the
execution can go to an unexpected branch and not produce an event.

Bug: 153824894
Change-Id: If117da0498eaf2d94c9610552724981be34c6569
2020-04-15 12:45:11 -07:00
Vinit Nayak 770cc42685 Revert "Cleanup code related to ag/11035582"
This reverts commit a2a1f86dff.

Reason for revert: b/154068414

Change-Id: I1db0018fa97d5a5380651cf7d04a05a0abd62857
2020-04-15 05:24:10 +00:00
Vinit Nayak 02885183a4 Disable sensor manager for tests in platform am: fd3fc081d9 am: e21c4ec073 am: c90f5d74af am: ab0f9ee5f0
Change-Id: If75533e7330ee94a7ce2481aae8b978100f043e0
2020-04-14 22:21:59 +00:00
Vinit Nayak a2a1f86dff Cleanup code related to ag/11035582
Bug: 153443049
Change-Id: I2a9e46fa4ffc613751c9f427ce892ddad3878b35
2020-04-14 14:02:49 -07:00
vadimt 0b65822f30 Temporarily disabling events checking in git_master
Bug: 153824894
Change-Id: I5f294d1a808b1ceefd0b753de6c9207cf92de06d
2020-04-14 01:31:57 +00:00
Vinit Nayak fd3fc081d9 Disable sensor manager for tests in platform
Bug: 153443049
Change-Id: Ieaa4b8144eba11c5d3025a1bcca42a8552d1c702
(cherry picked from commit 1a09958626)
2020-04-13 23:43:05 +00:00
Vinit Nayak 1a09958626 Disable sensor manager for tests in platform
Bug: 153443049
Change-Id: Ieaa4b8144eba11c5d3025a1bcca42a8552d1c702
2020-04-13 15:47:02 -07:00
TreeHugger Robot 77cf9b780f Merge "Adding tracing for apparently skipping verifiable events" into ub-launcher3-rvc-dev 2020-04-10 03:01:05 +00:00
Sunny Goyal e396abf502 Moving model data structures to a separate file
Change-Id: I77ad7a5219e72d2e0d6c1803de2ac3ed6a65a8f7
2020-04-09 13:20:39 -07:00
vadimt 8cb2f9ce08 Adding tracing for apparently skipping verifiable events
Bug: 153670015
Change-Id: I481c095f1245ba4252eb07e08b4130c857dd6e72
2020-04-09 13:02:48 -07:00
TreeHugger Robot e8fade9140 Merge "Adding diags to getWidget" into ub-launcher3-rvc-dev 2020-04-09 04:47:09 +00:00
vadimt 9915a7c60f TAPL waits for widgets recycler to become scrollable
On the Launcher side, moving setLayoutFrozen from the posted action to
avoid a possible short scrollable period just after the view is shown.

Bug: 152354290
Change-Id: I7319236d8a6e49a7e017fd54d593ee131dff10a9
2020-04-08 18:56:52 -07:00
vadimt 180c2e10fc Adding diags to getWidget
Also avoiding scrolling widgets horizontally when the gesture could
happen in the lower system gesture area.

Change-Id: I80192db7e407f8c1715aad3b96178c00b5710e71
2020-04-08 21:12:20 +00:00
Matt Casey 884f8f217f Merging from ub-launcher3-master @ build 6369897
Test: manual, presubmit on the source branch
Bug:150504032

x20/teams/android-launcher/merge/ub-launcher3-master_6369897.html

Change-Id: Id94544cf790a7dcf0841f66648ac864bf2f530d4
2020-04-07 00:54:25 +00:00
Adam Cohen df83c9026d Merging from ub-launcher3-master @ build 6356169
Bug:150504032
Test: manual, presubmit on the source branch
x20/teams/android-launcher/merge/ub-launcher3-master_6356169.html

Change-Id: Ife6c578d9a1e212eccdf3cf9a0cd838132eb90f5
2020-04-03 18:34:45 +00:00
Vinit Nayak b9cb1e3c8f Merge "Re-enable orientation sensor for Overview animation" into ub-launcher3-master 2020-04-02 19:02:30 +00:00
Vinit Nayak 6b7cc3fdc2 Re-enable orientation sensor for Overview animation
Slight revert of ag/10668129 with adjustment
of disabling it for tests.

Fixes: 151456795
Test: Ran the labtest command for OOP
tests for crosshatch (where this issue
was first detected)

Change-Id: I315d138c2e4a6d4068304e9b5fb2e1b7feb34e63
2020-04-02 11:07:10 -07:00
vadimt 00a031fbab More diags for missing widgets
Bug: 152645831
Change-Id: Idf6584220328a0853cd8dd65ebb5c54bab9980fd
2020-04-01 15:33:35 -07:00
TreeHugger Robot 639aca6142 Merge "Catching StaleObjectException (and everything else) from get bounds" into ub-launcher3-master 2020-04-01 22:16:08 +00:00
TreeHugger Robot 7b4a1f5b3c Merge "Events checking for long press events" into ub-launcher3-master 2020-04-01 18:33:24 +00:00
TreeHugger Robot f1939f6f54 Merge "Including full diags from system alerts" into ub-launcher3-master 2020-04-01 18:20:32 +00:00
vadimt e277fec466 Events checking for long press events
Also fixing duplicate long press events resulting from both framework
and Launcher own detection reporting long presses.

Change-Id: Ib46de5bd60850f1c5578992c8c1172ddbc0961f3
2020-03-31 19:08:17 -07:00
vadimt 486744b173 Including full diags from system alerts
Change-Id: I779d3ccb683aea46e7e1b58ed088933d5685c183
2020-03-31 18:36:38 -07:00
vadimt bb3f515690 Catching StaleObjectException (and everything else) from get bounds
This will improve diags because fail() adds useful info to the message

Change-Id: I0a27f80c71a900078c94d9dd44d431fc206a37a0
2020-03-31 14:03:00 -07:00
vadimt 5486970e31 Improving events checks diags
Printing matching sequences and making putput more readable.

Change-Id: I3325aa2a8291096017533372f9da0f7550f39313
2020-03-30 13:21:19 -07:00
TreeHugger Robot 349e95f1e4 Merge "TAPL: Verifying activity start/stop events" into ub-launcher3-master 2020-03-28 03:45:24 +00:00
TreeHugger Robot f64cef8ee6 Merge "Adding more tracing for a widgets test flake" into ub-launcher3-master 2020-03-28 01:37:17 +00:00
vadimt 926ed41fab Adding more tracing for a widgets test flake
Bug: 152354290
Change-Id: Ie3ed8430e3f3d5c93f1bea698be46f2ddd22dea0
2020-03-27 17:40:32 -07:00
vadimt 75add7cef5 Debug tracing for "widget not present" flake
Bug: 152645831
Change-Id: I1e318650e45ab8e2a60eccef2f4f3c247b2a6b5b
2020-03-27 15:08:36 -07:00
vadimt 0dd1bd1113 TAPL: Verifying activity start/stop events
It also turned out that Pilfer event seems to come in a
non-deterministic order relative to the events from the Main and TIS
sequences. So I moved it to its own sequence.

Change-Id: Ie4ea5865afd900bebbd8287dad2372c94dce8ad5
2020-03-27 10:23:33 -07:00
vadimt 77e3e87038 Merging from ub-launcher3-master @ build 6327709
Bug:150504032
Test: manual, presubmit on the source branch
x20/teams/android-launcher/merge/ub-launcher3-master_rvc-dev_6327709.html

Change-Id: I0a135e14daf3671648f02999da13d323efb5fe81
2020-03-25 06:06:46 +00:00
vadimt 7a9f1628f2 Repeating unlocking the phone several times
Bug: 151613234
Change-Id: Id5cbc247d7827fa31c2011d817b2964c1486daeb
2020-03-21 15:09:39 -07:00
vadimt 7500c241ac Increasing wait time till unlock
Bug: 151613234
Change-Id: I47e0a87551cebf31fa309b9a65b2ecff809a7f00
2020-03-21 13:04:15 -07:00
Vadim Tryshev b66ba0bae7 Merge "Adding more checks around unlocking the phone" into ub-launcher3-master 2020-03-21 04:03:32 +00:00
TreeHugger Robot 0ddd265fdb Merge "[Flake test] add state checks for WorkTabTest#testWorkEduIntermittent" into ub-launcher3-master 2020-03-21 02:14:49 +00:00
vadimt 330fde4aaf Adding more checks around unlocking the phone
Bug: 151613234
Change-Id: I045306cce2ce85d6895c9f050ebb4d2bd15ba232
2020-03-20 18:55:53 -07:00
TreeHugger Robot 1af6be57c8 Merge "Disable battery defender to avoid locking during the test" into ub-launcher3-master 2020-03-20 23:20:57 +00:00
vadimt 1b4247d9cd Disable battery defender to avoid locking during the test
Bug: 151613234
Change-Id: Id323025c1a3bb53cc39839aa2295fcd25436e68e
2020-03-20 14:26:31 -07:00
TreeHugger Robot 7d3a113d05 Merge "Work profile accessibility fixes" into ub-launcher3-master 2020-03-20 20:46:25 +00:00
Samuel Fufa 7f6baf9f60 [Flake test] add state checks for WorkTabTest#testWorkEduIntermittent
Bug: 151768149
Test: labtest
Change-Id: I676175629c60662763b26ce24eba4a361784fbeb
2020-03-20 13:28:00 -07:00
Samuel Fufa 45c3b10448 Work profile accessibility fixes
- Remove TextView and use work switches text
- Allow talkback to read recyclerview overlay

Bug: 151884799
Bug: 151803591
Bug: 151274763
Bug: 151585835
Test: Manual
Change-Id: Ieee0d37d0244eb12ecb923d710cbbd6a86281062
2020-03-20 11:52:03 -07:00
vadimt d8070756f1 Making sure the device doesn't lock during test execution
Unlocking the device at the beginning
of the test does help, but perhaps we should prevent
locking during the test execution.
Some failures still remain.

Bug: 151613234
2020-03-19 20:33:47 +00:00
vadimt 14b60d77b7 Unlocking device from the test
This is a workaround for the infra not unlocking
the device properly.

I don't have access to may machine, so
I've created this CL in Gerrit editor, didn't test,
but it should work.

Bug: 151613234
2020-03-19 17:59:34 +00:00
Winson Chung c18b7a4b04 Revert^2 "Merging from ub-launcher3-master @ build 6294827"
70a76a61bf
Bug: 151611270
Change-Id: I16e0afcda998d2b1293ff47a66d5562fa4da77dc
2020-03-17 20:51:09 +00:00
Anthony Stange 70a76a61bf Revert "Merging from ub-launcher3-master @ build 6294827"
Revert "Merging from ub-launcher3-master @ build 6294827"

Revert "Merging from ub-launcher3-master @ build 6294827"

Revert "Merging from ub-launcher3-master @ build 6294827"

Revert "Merging from ub-launcher3-master @ build 6294827"

Revert submission 10673936-merge_ub-launcher3-master_6294827

Reason for revert: b/151611270
Reverted Changes:
I38a587a1b:Merging from ub-launcher3-master @ build 6294827
I74ae8bea8:Merging from ub-launcher3-master @ build 6294827
I115742e03:Merging from ub-launcher3-master @ build 6294827
Iceb1e8523:Merging from ub-launcher3-master @ build 6294827
Ie242e3907:Merging from ub-launcher3-master @ build 6294827
I609b18fdd:Merging from ub-launcher3-master @ build 6294827

Change-Id: I96f08492cb92e2f670375269423d8b45a81312cf
2020-03-16 15:24:15 +00:00
Vinit Nayak 8674a882f6 Merging from ub-launcher3-master @ build 6294827
Bug:150504032
 Test: manual, presubmit on the source branch
 x20/teams/android-launcher/merge/ub-launcher3-master_rvc-dev_6294827.html

Change-Id: I74ae8bea8c64f116ca7663569cc0e9569f506ca5
2020-03-16 06:14:18 +00:00
TreeHugger Robot f85fcc792f Merge "Hide work apps when work profile is paused" into ub-launcher3-master 2020-03-12 18:12:59 +00:00
Samuel Fufa f5a4deb120 Hide work apps when work profile is paused
- hide overlay icon in landscape mode
- don't show edu if user has already seen legacy work profile edu
- make sure personal tab is highlighted when work profile is reinstalled
- always go home after a work profile is added or removed
- add tests for work edu flow

Bug: 150122946
Test: Manual
Change-Id: I8f80ac763acf03ca31a534464f4ddfd84528d329
2020-03-12 10:25:50 -07:00
TreeHugger Robot e6df7da2a2 Merge "Enabling event verification for Launcher3" into ub-launcher3-master 2020-03-07 07:19:13 +00:00
TreeHugger Robot d9da5a45fd Merge "Enabling widget config tests after fixing flakiness" into ub-launcher3-master 2020-03-06 06:53:51 +00:00
Vinit Nayak 8f03c5c1ce Merging from ub-launcher3-master @ build 6269120
Bug:150504032
Test: manual, presubmit on the source branch
x20/teams/android-launcher/merge/ub-launcher3-master_rvc-dev_6269120.html
Change-Id: I17d430abf3804e30d5d76628c2a4e693d4f1d700
2020-03-06 03:50:15 +00:00
vadimt 16eca5500d Enabling event verification for Launcher3
Will help investigating otherwise mysterious failures.

Change-Id: I805ed136baf6d86921fdb4782304fcdafbd3af5c
2020-03-05 19:02:18 -08:00
TreeHugger Robot f67ab6c64d Merge "Catching everything from dumpHprofData" into ub-launcher3-master 2020-03-06 02:14:19 +00:00
vadimt bb2bf277c0 Catching everything from dumpHprofData
Change-Id: I79ced1d4bb3e6ea43ce6fa5bd07fe22b577006f9
2020-03-05 17:22:18 -08:00
vadimt 3abc8511a5 Enabling widget config tests after fixing flakiness
Bug: 148867106
Change-Id: I8bbd9ef9b1ca574f79f3f76869051495b59734ce
2020-03-05 15:01:38 -08:00
vadimt 6d605da821 Verifying that tests run against a matching Launcher version
Change-Id: I3a6c9e1a2487cfd571abdf4bdd18ab17c7ac9406
2020-03-05 13:36:12 -08:00
Sreyas Rangaraju 75f7e649c0 Merge "OverviewActions: Creating single view instance. Makes use of there being a single instance of OverviewActionsView rather than each Task having it's own." into ub-launcher3-master 2020-03-04 22:40:35 +00:00
Sreyas 321bfae905 OverviewActions: Creating single view instance.
Makes use of there being a single instance of OverviewActionsView
rather than each Task having it's own.

Change-Id: I881121f84de99cade3cd8f07fa8510a557b28f57
2020-03-04 11:38:59 -08:00
Vadim Tryshev 0ae6433a61 Merge "Saving heap dump immediately as reported by StrictMode" into ub-launcher3-master 2020-03-04 19:31:55 +00:00
TreeHugger Robot fe41c3af21 Merge "Allow Launcher to automatically restore widgets" into ub-launcher3-master 2020-03-04 00:16:09 +00:00
Samuel Fufa 9151c011b9 Allow Launcher to automatically restore widgets
This replaces PendingAppWidgetHostView with configured widget view when
OPTION_APPWIDGET_RESTORE_COMPLETED is set to True by a widget provider.

Bug: 63667276
Test: Manual
Change-Id: Ide21f5e9a7dac7e3d6a745660a38ad0b951b47d3
2020-03-03 15:35:48 -08:00
vadimt 3d9dad3b9b Saving heap dump immediately as reported by StrictMode
Can do this via API with the exact heap state that triggered the
callback because using API allows to avoid deadlock that we'd have in
main thread if we used shell command.

checkDetectedLeaks() is still needed, as I'll add throwing an
exception there soon.

Bug: 139137636
Change-Id: I3c8670071b058c5c146ac58bb16152c980553065
2020-03-03 18:21:07 +00:00
TreeHugger Robot b83399b46e Merge "Fixing activity being referred after destroying." into ub-launcher3-master 2020-03-03 18:09:11 +00:00
vadimt b1eaa1752e Fixing activity being referred after destroying.
This is perhaps not a leak, but it conflicts with how StrictMode
activity leak detection works.

Bug: 139137636
Change-Id: I1608e348d8b238142c42ed81ae125fd07ef6b673
2020-03-02 18:36:01 -08:00
Vinit Nayak a406f727ad Add vertical layout support for Overview in portrait
WM is making changes which allows apps to maintain
their orientation independent of the orientation of
the foreground app. This allows recents to always start
in portrait even when the app currently running is in
landscape. This means we have to give the illusion of
a landscape oriented overview when user swipes up in
gesterual nav when launcher is started in portrait
configuration.

PagedOrientationHandler abstracts all coordinate specific
logic from Paged/RecentsView primarily, but also all
other dynamic calculations throughout launcher.
PagedViewOrientationState is the single point of exposure
to other classes that depend on those changes. The goal
is to also minimize holding state to allow for default
implementations of PagedOrientationHandler for all the
3p/Fallback classes. PagedViewOrientationState also
holds other data around rotation that isn't
specifically tied to view logic.

The fake landscape overview can be toggled with:
adb shell settings put global forced_rotation [0/1]

Fixes: 146176182
Change-Id: I65d8d4e9f92b93931cbe0053ccaf0cda8d2ffd6c
2020-03-02 18:02:35 -08:00
Vadim Tryshev 1f2182683e Merge "Not failing when getSystemAnomaly fails" into ub-launcher3-master 2020-03-02 19:41:35 +00:00
Mehdi Alizadeh 3210c06687 Merging from ub-launcher3-master @ build 6248758
Test: manual, presubmit on the source branch
http: //x20/teams/android-launcher/merge/ub-launcher3-master_6248758.html
Change-Id: I1c64ab220493793ba10cbbecf38a4df8381d8a54
Bug: 150504032
2020-02-29 01:52:25 +00:00
Vadim Tryshev d8995a6fda Merge "Revert "TAPL: Verifying activity start/stop events"" into ub-launcher3-master 2020-02-28 22:29:47 +00:00
Vadim Tryshev 3dd64ca3a8 Revert "TAPL: Verifying activity start/stop events"
This reverts commit 1186700c9a.

Reason for revert: Fails in the lab

Change-Id: I6715a058c76d96752b904331968b46a07ce93f85
2020-02-28 22:28:16 +00:00
Vadim Tryshev 3be0443d37 Merge "Revert "Enabling flaky tests per our new flaky test policy"" into ub-launcher3-master 2020-02-28 21:34:25 +00:00
Vadim Tryshev f450b2500c Revert "Enabling flaky tests per our new flaky test policy"
This reverts commit 983145c594.

Reason for revert: Too flaky

Change-Id: Ifabb638d6ce0a539518bc0b6b667a9783b6ca29d
2020-02-28 21:33:16 +00:00
Zak Cohen 23ceafe3d5 Merge "TAPL tests - make all apps in overview checks less fragile." into ub-launcher3-master 2020-02-28 21:21:36 +00:00
vadimt 18b9f396d6 Not failing when getSystemAnomaly fails
It's a supplemental method, and mysterious glitches that happen during
its work shouldn't cause the whole test to crash.

Example:
java.lang.NullPointerException: Attempt to read from field 'com.android.server.appwidget.AppWidgetServiceImpl$ProviderId com.android.server.appwidget.AppWidgetServiceImpl$Provider.id' on a null object reference
	at android.os.Parcel.createExceptionOrNull(Parcel.java:2291)
	at android.os.Parcel.createException(Parcel.java:2269)
	at android.os.Parcel.readException(Parcel.java:2252)
	at android.os.Parcel.readException(Parcel.java:2194)
	at android.accessibilityservice.IAccessibilityServiceConnection$Stub$Proxy.findAccessibilityNodeInfoByAccessibilityId(IAccessibilityServiceConnection.java:875)
	at android.view.accessibility.AccessibilityInteractionClient.findAccessibilityNodeInfoByAccessibilityId(AccessibilityInteractionClient.java:430)
	at android.view.accessibility.AccessibilityInteractionClient.getRootInActiveWindow(AccessibilityInteractionClient.java:214)
	at android.app.UiAutomation.getRootInActiveWindow(UiAutomation.java:607)
	at androidx.test.uiautomator.UiDevice.getWindowRoots(UiDevice.java:1102)
	at androidx.test.uiautomator.UiDevice.findObject(UiDevice.java:150)
	at com.android.launcher3.tapl.LauncherInstrumentation.getSystemAnomalyMessage(LauncherInstrumentation.java:334)
	at com.android.launcher3.tapl.LauncherInstrumentation.getAnomalyMessage(LauncherInstrumentation.java:359)
	at com.android.launcher3.tapl.LauncherInstrumentation.checkForAnomaly(LauncherInstrumentation.java:369)
	at com.android.launcher3.tapl.LauncherInstrumentation.lambda$eventsCheck$11(LauncherInstrumentation.java:1269)
	at com.android.launcher3.tapl.LauncherInstrumentation.lambda$eventsCheck$11$LauncherInstrumentation(Unknown Source:0)
	at com.android.launcher3.tapl.-$$Lambda$LauncherInstrumentation$3iFY1gd72Tm3mPf31PMij-eBaBk.close(Unknown Source:2)
	at com.android.launcher3.tapl.AddToHomeScreenPrompt.addAutomatically(AddToHomeScreenPrompt.java:53)
	at com.android.launcher3.ui.widget.RequestPinItemTest.runTest(RequestPinItemTest.java:163)
	at com.android.launcher3.ui.widget.RequestPinItemTest.testPinWidgetNoConfig_customPreview(RequestPinItemTest.java:95)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:52)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:148)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:142)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.lang.Thread.run(Thread.java:923)
Caused by: android.os.RemoteException: Remote stack trace:
	at com.android.server.appwidget.AppWidgetServiceImpl$AppWidgetManagerLocal.getHostedWidgetPackages(AppWidgetServiceImpl.java:4887)
	at com.android.server.accessibility.AccessibilitySecurityPolicy.computeValidReportedPackages(AccessibilitySecurityPolicy.java:229)
	at com.android.server.accessibility.AbstractAccessibilityServiceConnection.findAccessibilityNodeInfoByAccessibilityId(AbstractAccessibilityServiceConnection.java:621)
	at android.accessibilityservice.IAccessibilityServiceConnection$Stub.onTransact(IAccessibilityServiceConnection.java:372)
	at android.os.Binder.execTransactInternal(Binder.java:1138)

Change-Id: If7ae23d07b69d524c3f300607f0866cce6405416
2020-02-28 12:08:19 -08:00
Zak Cohen dc24231e4f TAPL tests - make all apps in overview checks less fragile.
Tests that check for all apps in overview mode were only checking for
actions being enabled. This isn't sufficient logic, two button mode also
uses all apps.

Centralize the check for all apps.

Test: local tapl tests
Change-Id: If1bf98019e6f1aea8f7967883aba6780743e9d6b
2020-02-28 11:59:33 -08:00
Vadim Tryshev 64a932ed2a Merge "TAPL: Verifying activity start/stop events" into ub-launcher3-master 2020-02-28 19:22:32 +00:00
Vadim Tryshev 1fabbf5a23 Merge "Enabling flaky tests per our new flaky test policy" into ub-launcher3-master 2020-02-28 18:29:23 +00:00
vadimt 983145c594 Enabling flaky tests per our new flaky test policy
I'll check whether the tests are still flaky and assign to the test
owner if they are.

Bug: 148867106
Change-Id: Ic850abc862b0f266b100aa6bfff4e89b3802e50d
2020-02-27 17:59:32 -08:00
Zak Cohen eecb258cc7 Merge changes from topic "enable" into ub-launcher3-master
* changes:
  Overview Actions - Enable by default.
  TAPL test update - don't run all apps in overview tests with actions.
2020-02-27 19:48:51 +00:00
Vadim Tryshev 0e0b176361 Merge "Not showing "mismatched events" and other diags after Launcher crashes" into ub-launcher3-master 2020-02-27 19:45:39 +00:00
TreeHugger Robot 3ba6800552 Merge "Using StrictMode to detect activity leaks" into ub-launcher3-master 2020-02-27 19:19:14 +00:00
vadimt 1186700c9a TAPL: Verifying activity start/stop events
It also turned out that Pilfer event seems to come in a
non-deterministic order relative to the events from the Main and TIS
sequences. So I moved it to its own sequence.

Change-Id: I5851aafb6d04398c5727712eaf8561916a30c4c5
2020-02-27 11:12:35 -08:00
Vadim Tryshev 9f62bc10af Merge "Remove unnecessary PilferPointer events and enable testPressHomeOnAllAppsContextMenu" into ub-launcher3-master 2020-02-27 19:08:29 +00:00
TreeHugger Robot 39c610192a Merge "Catching OOM exceptions in auto-investigator" into ub-launcher3-master 2020-02-27 01:14:52 +00:00
vadimt da12b805cc Not showing "mismatched events" and other diags after Launcher crashes
Change-Id: Iee5f8813c3610314d486589bc361466a05da0ecb
2020-02-26 12:19:32 -08:00
TreeHugger Robot 833cd43206 Merge "Adding a failure investigator" into ub-launcher3-master 2020-02-26 17:47:59 +00:00
vadimt dbc7583054 Remove unnecessary PilferPointer events and enable testPressHomeOnAllAppsContextMenu
Change-Id: I04199f46024b05f05d04ba2be7a797842bb48527
2020-02-25 18:17:04 -08:00
Zak Cohen fe935dfbc1 TAPL test update - don't run all apps in overview tests with actions.
Overview actions removes the all apps from overview. Don't run the tests
that depend on these.
Ultimately need to add more tests for the actions.

Test: tapl local
Change-Id: I2471d10af7bc03a40a94f99aa16354b85bdb3ad7
2020-02-25 15:09:12 -08:00
vadimt 1779a38290 Using StrictMode to detect activity leaks
Change-Id: I615f641897d57be0cd31be944796c6931ef9ab00
2020-02-25 14:46:27 -08:00
vadimt 6f96376620 Catching OOM exceptions in auto-investigator
In the development environment, the device may stay for long time
without reboot, and the logcat size may turn to be long enough to
overflow the memory.

Suppressing OOM exceptions.

Change-Id: I562e2c03312e88f669d9cb660af6e8849dc0c8ef
2020-02-25 11:05:39 -08:00
vadimt 65ed9c3d9b Adding a failure investigator
Change-Id: Ie1c9820ecb7373a1f4428a24867c51332a84e65c
2020-02-24 19:10:50 -08:00
vadimt b79614cc93 Performing a check for a crashed Launcher process for each UI test 2020-02-25 02:28:32 +00:00
Sreyas a241df66df OverviewActions: Creating parent view to house RecentsView and Overview Actions.
Creating RecentsViewHolder to be contain LauncherRecentsView in OverviewPanel so Overview Actions View can be created only once.

Change-Id: I111f88903d2ff80275cc2e07b761577260073c17
2020-02-21 16:14:51 -08:00
Vadim Tryshev 1562d104b8 Merge "Updating logcat reading logic" into ub-launcher3-master 2020-02-21 00:27:46 +00:00
vadimt 2f41808e9b Updating logcat reading logic
Start a thread to read logcat synchronusly instead
of back-tracking at the end of the test

Also:
* Reusing the same logcat process for all checks. This eliminates
reading the log from its start for every gesture. We don’t kill that
process at the end, and don’t stop the thread. I’ve verified that
“am instrument” doesn’t hang, and the logcat process gets automatically
killed after the test process exits.
* Not using mStarted latch, as there is no need to wait until the reader
reaches the start mark.

Bug: 149422395
Change-Id: Ide4ed19ad8d099c41918f38c2b073b8b2e143b69
2020-02-20 22:02:52 +00:00
Samuel Fufa aeaad97eb7 Increase timeout for WorkTabTest.toggleWorks test
Bug: 149927292
Change-Id: I6dcd0bfa2fe584be9e46f653992f9c748e795614
2020-02-20 11:22:49 -08:00
Samuel Fufa d1c0779726 Increase timeout for flaky work test
Bug:149867607
Change-Id: Ic746a4857a47fc29372d19419ddfa6eaebd06f87
2020-02-19 17:08:26 -08:00
Jon Miranda 98e484548c Merging from ub-launcher3-master @ build 6219992
Test: manual, presubmit on the source branch
http://x20/teams/android-launcher/merge/ub-launcher3-master_6219992.html

Change-Id: Iff1e0d32b4ded4cb51c91c187d85f128b92157ca
2020-02-19 13:11:10 -08:00
Samuel Fufa f240ef2a0c Merge "Add Tests for work profile toggle" into ub-launcher3-master 2020-02-16 02:28:23 +00:00
TreeHugger Robot 2c87fb99f6 Merge "Revert "Enabling testPressHomeOnAllAppsContextMenu while fixing failure cause"" into ub-launcher3-master 2020-02-15 07:02:24 +00:00
Vadim Tryshev 47b3588ba5 Revert "Enabling testPressHomeOnAllAppsContextMenu while fixing failure cause"
This reverts commit c2842d8f4a.

Reason for revert: CL broke TaplTestsLauncher3.testDevicePressMenu in 2-button mode

Change-Id: Idebda69a36b94686415434e8e3f158a8a7abc5bb
2020-02-15 02:25:35 +00:00
TreeHugger Robot fa19162a0c Merge "Starting querying logcat events 1 min before start of the gesture" into ub-launcher3-master 2020-02-15 01:31:42 +00:00
vadimt c2842d8f4a Enabling testPressHomeOnAllAppsContextMenu while fixing failure cause
Change-Id: I012d5144651f5e7fb362caaef6eec8cee7622fb4
2020-02-14 14:50:28 -08:00
vadimt 05f3a21fca Starting querying logcat events 1 min before start of the gesture
This is a temporary attempt to solve the supposed unreliability of the
"-t" parameter of logcat while the permanent solution (ag/10290062) is
being reviewed.

Bug: 149422395
Change-Id: I327a94de4349bb6cea32f9b8f66bb6e292725b8f
2020-02-14 11:30:14 -08:00
Samuel Fufa ea4dcf468e Add Tests for work profile toggle
+ Fix minor style issues

Bug: 140099753
Bug: 112899690
Test: Manual
Change-Id: I1257560be79748abe54a75a74d93caa4390943b5
2020-02-13 17:21:54 -08:00
Thiru Ramasamy f40c579524 Merge "Initial draft of smart folder logging to clearcut pipeline." into ub-launcher3-master 2020-02-14 00:49:14 +00:00
thiruram c1c2bfa7fb Initial draft of smart folder logging to clearcut pipeline.
* Adds additional fields to launcher_log.proto to capture smart folder related information.
* Uses ProtoLite to generate log object using builder pattern and converts to nano version before writing to clearcut. Hence not making drastic change to existing logging pattern.

Change-Id: I89b10da8d4e35e3abc7ddb553046946f91b43445
2020-02-13 13:32:21 -08:00
vadimt 68e8578588 Not trying to disable running tests after a failed finalizer
Turns out there is no good way to know that an exception comes from a
finalizer.

Change-Id: I0cb2c518d0b7dc20ad7734ed46ba6af1b8a9d36e
2020-02-11 13:27:17 -08:00
TreeHugger Robot 9f3cf1aa07 Merge "Restoring generating screenshots of failures" into ub-launcher3-master 2020-02-11 04:39:33 +00:00
Vadim Tryshev 47a73672db Merge "Verifying events from TouchInteractionService" into ub-launcher3-master 2020-02-11 01:46:53 +00:00
vadimt 1006f73a95 TAPL: Start getting events 10 sec ahead of the first expected one
This is a workaround for -t param skipping 4 first sec of recording.

Change-Id: I834d83f5f4ba760171209ab2e06ae40ea4aa9e25
2020-02-10 13:49:29 -08:00
TreeHugger Robot ee205a0292 Merge "Making some TAPL members public so that tests could use them directly" into ub-launcher3-master 2020-02-08 09:35:35 +00:00
vadimt 6c95453a19 Restoring generating screenshots of failures
Now correctly inheriting from a statement.

Change-Id: I7fdf03c8ce144ba31d978950af7e71a09004ae1e
2020-02-07 19:43:08 -08:00
vadimt 359cc2a5e5 Making some TAPL members public so that tests could use them directly
Change-Id: I508d25d404a073f5bf76762e0b129e09b46b1582
2020-02-07 18:06:01 -08:00
TreeHugger Robot 93d3117295 Merge "Events: moving logcat filter 1 sec back" into ub-launcher3-master 2020-02-08 00:56:04 +00:00
TreeHugger Robot 3042387909 Merge "remove stability annotation since it hasn't been flaking in the last month" into ub-launcher3-master 2020-02-07 22:46:03 +00:00
vadimt f81dc291ba Events: moving logcat filter 1 sec back
I saw flakes when logcat didn't return records that are 300ms after the
specified time. I hope that moving the start time 1 sec back will
workaround this.

Change-Id: I6a4b66094d38f555d10284f19a71152a8be47b2e
2020-02-07 14:00:54 -08:00
Pinyao Ting 796891bc06 remove stability annotation since it hasn't been flaking in the last
month

Bug: 146432215
Test: run flake locally
Change-Id: Ie7604088e82451f2c705f143d70af3f5c3b9c52d
2020-02-07 13:50:20 -08:00
TreeHugger Robot 958995a771 Merge "Fixing race condition on test information provider" into ub-launcher3-master 2020-02-07 21:09:11 +00:00
Sunny Goyal 5fffa47cac Fixing race condition on test information provider
Activity tracker is accessed on a non-UI thread, which can cause a non-initialized
Launcher to be treated as initialized

Bug: 149022794
Change-Id: I6634a6aff891592369c16469bbe95a9ea611819c
2020-02-07 12:37:44 -08:00
vadimt d633c9c7da Verifying events from TouchInteractionService
There is a guaranteed order in which TIS events will be registered
relative to other TIS events. However, relative to the touch events
arriving to the activity, TIS events can come in any order.

Now the event checker verifies 2 independent ordered event sequences:
from TIS, and “the rest” (Main).

Change-Id: I5872e0e3b0b498050a91c67105fbe4a29411375a
2020-02-07 11:46:03 -08:00
TreeHugger Robot 352e750e80 Merge "Increasing nav mode settlement timeout as an attempt to workaround nav mode mismatch bug." into ub-launcher3-master 2020-02-07 19:08:08 +00:00
TreeHugger Robot 8c2f22e5ab Merge "Adding one more automatic flake classifier" into ub-launcher3-master 2020-02-07 18:46:40 +00:00
vadimt c71db98747 Increasing nav mode settlement timeout as an attempt to workaround nav
mode mismatch bug.

Bug: 148422894
Change-Id: I1295c1415a308ec461d302c9973309f4de77f984
2020-02-07 10:34:59 -08:00
TreeHugger Robot 70607cfe0a Merge "Attempt to workaround navigation mode mismatch errors" into ub-launcher3-master 2020-02-07 01:10:23 +00:00
TreeHugger Robot b2c5eb3ad0 Merge "Investigator: adding "Screen is empty" as another sign of crashed sysui" into ub-launcher3-master 2020-02-06 23:53:29 +00:00
vadimt ec9c109c46 Attempt to workaround navigation mode mismatch errors
Assuming that the nav mode state needs to "settle", adding waiting for
this.

This might be a temporary solution.

Bug: 149024111
Change-Id: Ifbd874546a4cb6b07ad3d3825c95d19bc5836b38
2020-02-06 23:14:49 +00:00
Hongwei Wang 51c6fdf7c3 Merging from ub-launcher3-master @ build 6188107
Test: manual, presubmit on the source branch
http://x20/teams/android-launcher/merge/ub-launcher3-master_6188107.html

Change-Id: I84c1ea301508ba5f0f3d337a423cea8e61832c0d
2020-02-06 15:03:07 -08:00
TreeHugger Robot 8b65dbc9a7 Merge "Disable testWidgetConfig" into ub-launcher3-master 2020-02-06 19:51:49 +00:00
vadimt 6a1cb09890 Disable testWidgetConfig
Bug: 148867106
Change-Id: I3957f03d2f30f340cc3e90626927f7d62624c120
2020-02-06 10:41:42 -08:00
Vadim Tryshev 328c9e5ac6 Merge "More diags for logic disabling other tests after a finalizer failure" into ub-launcher3-master 2020-02-06 03:27:39 +00:00
TreeHugger Robot 86c1807d3c Merge "Disable failing test testConfigCancelled" into ub-launcher3-master 2020-02-06 01:33:59 +00:00
TreeHugger Robot a0912d502a Merge "Making test run flavor available to tests." into ub-launcher3-master 2020-02-05 20:54:12 +00:00
TreeHugger Robot c3b8ff4448 Merge "TAPL: Verifying pilferPointers events" into ub-launcher3-master 2020-02-05 19:28:20 +00:00
vadimt 9702355d71 Disable failing test testConfigCancelled
Bug: 148867106
Change-Id: Ia1f4b7ef43ddde6de85d3c6852b3d3960090dd09
2020-02-05 11:12:54 -08:00
vadimt b8a54f967b Adding one more automatic flake classifier
Change-Id: I5ab68c3d02a5e82081485b0845b0e7c24280aa1c
2020-02-04 18:13:52 -08:00
vadimt ae701bfcc4 Investigator: adding "Screen is empty" as another sign of crashed sysui
Also generating recognizable anomaly message in more cases

Change-Id: Ia4d4d87a1a46291f3ea1057e00acbd98d9ccb3a5
2020-02-04 12:06:18 -08:00
vadimt 8211b6a021 More diags for logic disabling other tests after a finalizer failure
Change-Id: I4af56b2b83b204b9a5a383a26a3d845a88a96bf1
2020-02-04 03:11:06 +00:00
vadimt 890540a977 Making test run flavor available to tests.
Bug: 139137636
Change-Id: If08006da4f5dedfeab93c4f0502f8938a2b64c8f
2020-02-04 01:57:53 +00:00
TreeHugger Robot 8c6cff249e Merge "Enabling quick switch test" into ub-launcher3-master 2020-02-01 02:25:09 +00:00
vadimt db185f6b3e Enabling quick switch test
Now that 2 underlying bugs are fixed

Bug: 143285809
Change-Id: Ie85177830def6e6ee72688f7dbb15ebef9c5ae48
2020-01-31 17:27:46 -08:00
vadimt 7505222183 TAPL: Verifying pilferPointers events
Change-Id: Ie825beb4b3adf7fea28959b460e99a44bc471063
2020-01-31 11:22:43 -08:00
vadimt e2446c8cad Rewriting failure investigator database in a more readable way
Change-Id: Iccf2e8e0a45dbbcd8f2600d9094d6a10eabaf3da
2020-01-30 19:25:03 -08:00
vadimt 01372013d3 Recognizing another SystemUI failure
Also switching investigator to logs starting with the system reboot, as
SysUI crashes before the tests start.

Change-Id: Ifab835c1ab3c1ce3495f012c6a522fae6e44a9ff
2020-01-30 17:57:50 -08:00
Sunny Goyal 9c2b96090b Adding SecondaryDisplayLauncher in Launcher using common listener
Bug: 141596722
Change-Id: I480bfadf592f7d0309f17c33a3fe14bb77fb5586
2020-01-30 08:27:27 +00:00
TreeHugger Robot ae5e991f5e Merge "Not crashing tests when a test fails to deinitialize" into ub-launcher3-master 2020-01-29 21:46:27 +00:00
TreeHugger Robot 07ccd59adf Merge "Adding sysui crash diagnostic with a new fingerprint" into ub-launcher3-master 2020-01-29 19:07:16 +00:00
TreeHugger Robot 6f7f380dde Merge "Verifying the event for pressing square button" into ub-launcher3-master 2020-01-29 19:01:56 +00:00
TreeHugger Robot 0618d689e8 Merge changes from topic "state-supplier" into ub-launcher3-master
* changes:
  Translate recents slightly while dragging after pausing
  Two-zone model: swipe up from nav bar vs above it
  Change LauncherState to Supplier<LauncherState> in tests
2020-01-29 03:06:04 +00:00
Tony Wickham fd239cafbe Translate recents slightly while dragging after pausing
There's a lot of resistance, but feels better than nothing
responding to your movement.

Bug: 143361609
Change-Id: I9d7e06279ebdbaa0317909ce96d6f001dbe9699a
2020-01-28 18:31:14 -08:00
vadimt 8196e7984a Verifying the event for pressing square button
Change-Id: If7e3cf29e3a069a295f2612800ddbbfc27653c32
2020-01-28 18:23:05 -08:00
Tony Wickham 8a054061ef Change LauncherState to Supplier<LauncherState> in tests
This prevents the test from statically initializing LauncherState and
all its static dependencies, which might lead to runtime exceptions in
out-of-proc tests.

Change-Id: I0e4e09dfb31a8b256c2c0c0b3d1d2ecd0cc92230
2020-01-28 18:07:33 -08:00
Sunny Goyal fc86a9c75c Removing unnecessary method from tests
Change-Id: I28b180b0e63b277b1bf2b206a848fc6ff14a2722
2020-01-28 10:45:48 -08:00
vadimt 053cb7a6e6 Not crashing tests when a test fails to deinitialize
This causes nondescript diags "Test failed to run to completion.
Reason: 'Instrumentation run failed due to 'Process crashed.''. Check
device logcat for details"

Now quietly skipping all consequent tests after such failure.

Change-Id: I3747cda1a3094bfe82e27eae39ba9e9dfd4af9b6
2020-01-27 19:26:00 -08:00
vadimt 95241ae0f7 Adding sysui crash diagnostic with a new fingerprint
Change-Id: I998e107c05a1993367818db604d4c1666be9b2c6
2020-01-27 18:43:23 -08:00
Vadim Tryshev 23cc769eb1 Merge "Adding autodiagnostics for setup wizard being active when tests start" into ub-launcher3-master 2020-01-27 21:36:05 +00:00
TreeHugger Robot 97e5c4c111 Merge "Additionally filtering events by time" into ub-launcher3-master 2020-01-27 18:14:23 +00:00
vadimt fd679b78ef Adding autodiagnostics for setup wizard being active when tests start
Change-Id: I78318897b36ee5c94e5ea55e7d1d8cb036fda33b
2020-01-24 14:43:23 -08:00
vadimt fcaab044a3 Avoid confusing errors "Launcher pid should be 0" when test setup fails
Change-Id: Ic5e8114a0f86d1a08738785c4098645e59a24975
2020-01-24 14:30:40 -08:00
vadimt 0fad650610 Additionally filtering events by time
Logcat may return records before the time requested via -t.
Filtering them out.

Also using year in date, to avoid failing during new year night.

Change-Id: I3c84d5fdf7882b3f551a1d430aa906fe1ae67aa7
2020-01-24 14:20:46 -08:00
TreeHugger Robot 8f76378bf5 Merge "Adding events checking for Launcher starting apps" into ub-launcher3-master 2020-01-24 20:23:39 +00:00
vadimt 6098a8c8c0 Adding events checking for Launcher starting apps
Change-Id: Id651397f643280a9f99a470df029479bd1b41e5c
2020-01-23 19:12:19 -08:00
vadimt 8bcabc02c3 Logging the time that we use for the current events range
It appears that sometimes logcat -d returns events that are earlier than
that time, but we need to be sure.

Example:
ACTION_UP from the previous TAPL method:
https://sponge.corp.google.com/target?show=FAILED&sortBy=STATUS&id=1aceab23-6d2a-4b2d-9630-47a74cafe7b9&target=com.google.android.apps.nexuslauncher.tests

Change-Id: Ib83e1cc01402ef638f8ac8a0862e16c5773b82cd
2020-01-23 17:44:38 -08:00
TreeHugger Robot 3c7f820e2b Merge "More readable formatting for events mismatch message" into ub-launcher3-master 2020-01-24 00:19:24 +00:00
vadimt daed318930 Recognizing a Launcher ANR
Change-Id: Ib26df7b6e9f9e6b85f93d2aa2a4a0204430e304f
2020-01-23 15:19:46 -08:00
vadimt ff7cd03d43 More readable formatting for events mismatch message
This helps for longer event lists.

Change-Id: Ie3565d2ccdde27d23770d01b4f9d4680bd8e229b
2020-01-23 13:40:54 -08:00
Vadim Tryshev 8cf7b03cad Merge "Adding auto-investigation of one more flake" into ub-launcher3-master 2020-01-23 20:17:33 +00:00
Sunny Goyal 3970b8b797 Merging from ub-launcher3-master @ build 6155931
Test: manual, presubmit on the source branch
http://x20/teams/android-launcher/merge/ub-launcher3-master_6155931.html

Change-Id: I2083903dafc81c9b35437054be6a42a0612f0749
2020-01-23 10:11:24 -08:00
vadimt 29d8b54957 Disabling events checks for successful gestures by default
Launcher tests will still perform checks upon every gesture completion.

All tests using tapl will still use events for diagnostics if the
gesture fails.

The benefit is that system health and other platform tests won't have to
use expensive logcat, and moreover, wait seconds for the events to
appear in logcat because of buffering in logcat.

Change-Id: I3b5a0965d9432144d0c4a8b40ebe2fa89b19a689
2020-01-22 19:16:32 -08:00
TreeHugger Robot 51ee9cf03e Merge "TAPL: verify input events" into ub-launcher3-master 2020-01-22 22:45:51 +00:00
vadimt 9af34a7b13 TAPL: verify input events
This will catch cases, for example, when the platform stops delivering
injected events to Launcher, or injects unexpected events, like Back
Button.

Also optimizing and fixing incorrect behavior of calculating the start
time for the event collection.

Change-Id: I2ba0108e6bfa112f2905a05bcb327b148ec08f77
2020-01-22 14:10:53 -08:00
vadimt 2c6316be46 Adding auto-investigation of one more flake
Reshuffling the tests to make the investigator the outmost rule and run
the code that throws the original exception inside the investigator.

Change-Id: I714717a9b616862db5ce59116138ba7ea6ceb971
2020-01-21 19:06:59 -08:00
TreeHugger Robot 1348e44378 Merge "TAPL: Optimization: avoid getting actual events twice" into ub-launcher3-master 2020-01-22 01:15:44 +00:00
Adam Cohen 6b9595f607 Merging from ub-launcher3-master @ build 6150369
Test: manual, presubmit on the source branch
http://x20/teams/android-launcher/merge/ub-launcher3-master_6150369.html

Change-Id: Ia79497c0a9f03cf6ad9e9daa58ed34c02a36e879
2020-01-22 01:10:38 +00:00
TreeHugger Robot d44326c2e7 Merge "Automatically diagnosing known flakes" into ub-launcher3-master 2020-01-21 22:56:35 +00:00
vadimt cffe99f0bb Automatically diagnosing known flakes
It often takes a long time to fix a flake; meanwhile it takes a lot of
time for sheriffs to identify whether to register a new flake for a
failure.

This CL adds automatic identifies identification of one know flake type.
Once identified, it rewrites the error so that:
1. Flakes clustering tool that has only rudimentary clustering, places
all flakes of this kind in the same cluster (not multiple ones like
now). This is a step towards using clustering tool for monitoring
flakes;
2. Sheriff immediately sees that the issue is known.

Change-Id: I86a0762665cb21434289e1be00b60bd76fec4142
2020-01-21 13:29:37 -08:00
TreeHugger Robot 9311785daf Merge "Better diags and a small correction for scrolling in AllApps" into ub-launcher3-master 2020-01-17 21:48:52 +00:00
vadimt 299aaf3a8a TAPL: performing event verification for all gestures
+ missed comments from earlier CLs

Change-Id: Iec84de66a3ff9c2aa59a11566560fa6f169190d0
2020-01-17 12:25:40 -08:00
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
vadimt f6c1a167d9 TAPL: Optimization: avoid getting actual events twice
Getting events is an expensive operation involving reading logcat. We
did this al least twice even if the number of events was already
sufficient. Fixing this.

Change-Id: I5bfb57e3b573c4fc3f0327512327750dbb35af2f
2020-01-16 14:44:51 -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
vadimt 9675452c2f Better diags and a small correction for scrolling in AllApps
Change-Id: I48dbba26139f42350831fb707bea847b7c76129f
2020-01-14 19:39:35 -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