Commit Graph

31 Commits

Author SHA1 Message Date
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
Thales Lima 1a2d4bd6f4 Create an XML parser for WorkspaceSpecs
Extract DeviceProfileTest to Launcher3 so it can be used in other tests as well, and change name of previous base test to be more descriptive.

Bug: 241386436
Test: WorkspaceSpecsTest
Change-Id: I64613bb5a23c374ed15fb6d936192236a541ab9b
2023-02-08 11:20:14 +00:00
Sunny Goyal 62ea1f1cb7 Re-enabling testShortcutIconWithTheme
> Updating shortcut id incache the icon cache was the culprit

Bug: 260722220
Test: Verified locally
Change-Id: I0e6bc9b06d1b99e33cb9b1a248647d54bf47dea4
2023-01-04 13:05:42 -08:00
Sunny Goyal ce4896cff5 Fixing shortcuts not getting theme icons
Bug: 238650110
Test: Updated ThemeIconsTest
Change-Id: I803cd6eefa4e393bf19901a44712622adac7f4b1
2022-11-28 09:48:50 -08:00
Sunny Goyal 39b07fd66c Fixing background jump when closing a widget
We do not add background animation when opening target is translucent
Added additional check to not animate background if launcher is not
closing (which is already a subset of all-targets-translucent)

Also removing reverse background animation from widgets, similar
to app-icons as it is never added for launcherNotClosing path

Bug: 242379946
Test: Added translucent activtiy and widget and verified manually
      that the behavior does not change
Change-Id: Icda8007c0063295bf8431c00a0f0b665ecdef109
2022-11-02 19:17:18 +00:00
Sebastian Franco 00aff95ac0 Give the tests the ability to emulate other devices screens
This code contains utility clases that can change the display
of a device and make it look like another device.
The function DisplayEmulator#emulate receives a DeviceEmulationData
a certain grid to emulate and a callback, everyting that happens
inside of the callback will happen when the device is being emulated
and can be used by other tests.

Example test:
package com.android.launcher3.deviceemulator;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import com.android.launcher3.deviceemulator.models.DeviceEmulationData;
import com.android.launcher3.ui.AbstractLauncherUiTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.concurrent.TimeUnit;

@MediumTest
@RunWith(AndroidJUnit4.class)
public class TestTest extends AbstractLauncherUiTest {
    @Test
    public void testEmulation() throws Exception {
        String deviceCode = "pixel6pro";
        DeviceEmulationData deviceData = DeviceEmulationData.getDevice(deviceCode);
        String grid = "normal";
        DisplayEmulator displayEmulator = new DisplayEmulator(mTargetContext);

        displayEmulator.emulate(deviceData, grid, () ->{
            TimeUnit.SECONDS.sleep(10);
            return true;
        });
    }
}

Test: You could use the test above to make your device look like a
Pixel6 pro for 10 secons.
Fix: 229028257

Change-Id: Icd79be405a2e14dda0bc5f555b0e46149e16f912
2022-04-25 11:57:58 -05:00
Sunny Goyal bcec90b081 Adding tests for themed icons support in Launcher
Bug: 205772453
Test: Presubmit
Change-Id: I2fc8cade8e103e5a7b3aa7349c870e613929464c
2022-02-25 13:35:18 -08:00
Sunny Goyal 777d49062f Revert "Revert "Migrating all model tests to Instrumentation tests""
This reverts commit 7a4a30d86d.

Test: Presubmit
Reason for revert: Fixing original bug

Bug: 196825541
Change-Id: Id4b1eb24a89564d264266d305aebea52917dfcd9
2021-08-31 10:51:52 +00:00
Alex Chau 7a4a30d86d Revert "Migrating all model tests to Instrumentation tests"
This reverts commit 455ba62b5d.

Reason for revert: Breaks tests on all targets

Bug: 196825541
Bug: 197570389
Change-Id: Ida6792a09c54dee46105b6b914a0dd1545bdf48d
2021-08-24 17:27:52 +00:00
Sunny Goyal 455ba62b5d Migrating all model tests to Instrumentation tests
Bug: 196825541
Test: Presubmit
Change-Id: Iebd46eb41eb46c187d569197f4b97b4fddc0f6f7
2021-08-23 12:34:44 -07:00
Pierre Barbier de Reuille 46fbb5c702 Update the test appwidget for dynamic colors
Fix: 184924547
Test: Installed widget locally
Change-Id: Icb50cfd5cec053c3cbe9b25fe317ad71e0b16bf6
2021-04-09 10:55:05 +01:00
Lucas Dupin 554a1bee39 Apply new color scheme
Bug: 173553055
Test: manual
Test: atest SystemPalette
Test: atest ThemeOverlayControllerTest
Test: atest DeviceDefaultThemeTest
Change-Id: Ie06160ed322ceac2e1078c24db287dd1f26a0a65
2021-03-20 11:00:13 -07:00
Pierre Barbier de Reuille ab33b76dce Launcher changes to support dynamic coloring on static widgets.
Bug: 179783721
Test: By hand using the AppWidgetDynamicColors widget
Change-Id: I27863cac31f2f6c29f5a717ff8d4492325f936fb
2021-03-10 22:04:35 +00:00
Jon Miranda 1d7ed30dba Remove widgets that no longer fit the workspace in their current spans.
This can happen when display size changes.
We compare span sizes of widget in the db to the min sizes of the widget
in the current display size. If the widget can no longer fit in its existing
spans, we remove it.

Also update test widgets to have minWidth/minHeight of 1dp. This ensures that
the spanX, spanY, min* values remain consistent between different test devices.

Bug: 168818961
Change-Id: I723372e4582658f78b2f23ced9073cb77977a6b8
2020-09-30 16:19:21 -07:00
Sunny Goyal 8f90d5da8a Adding test to check view inflation during swipe up
Bug: 137851409
Change-Id: Ic8e6f0b3c667051b921d1d4fad03c94122ee92e9
2019-09-20 15:36:02 -07:00
vadimt 8296c6132d Enabling tests for pausing apps
Bug: 123892607
Change-Id: I1fa90f6dd4312b9311b8e706b2119dc04e3e2389
2019-05-29 12:07:55 -07:00
vadimt b96898a025 Not using Settings app as a source of shortcuts
Bug: 126587956
Change-Id: I13ef4298a8133ff5773eef8658a04094d5d154da
(cherry picked from commit 476a511ca5)
2019-04-12 19:22:09 +00:00
Sunny Goyal c5939393a9 Bye bye workspace screens table
Removing a separate table for workspace screens. List of screens are
automatically parsed using the items in the favorites DB. Order of the
screen based on the screen id and rearranging screens is no longer
supported. In case the screens need to be rearranged, all the items
in the favorites db will need to be updated with new screen ids.

This makes backing up the DB (in the same database) easier as only
one table needs to be duplicates.

Change-Id: I8ba947a898f637d780e2f49925e78604263126e8
2018-12-10 11:43:35 -08:00
Sunny Goyal 06a07e9748 Moving come tests to Roboelectric
> Fixing resource loading in robo tests

Change-Id: Id5b8a0e4916a2a200da7a41b03f19846834beb1f
2018-11-12 10:49:59 -08:00
Vadim Tryshev 1b4560cf2a Adding dummy app apk for tests
Bug: 117888000
Test: In Nexus code
Change-Id: Ibf0b803c9db6b344ffbe5b7761efb2a2d86867c6
2018-11-05 10:36:21 -08:00
Winson Chung 1054d4e8f2 Revert "Revert "Adding support for hiding widgets from the widget tray and reconfiguring widgets""
This reverts commit f502e5faec.

Reason for revert: Reverting post-build

Change-Id: I09eb292dbbbe37ffaf3abc477aa2ddb5700093b8
2018-03-05 19:39:21 +00:00
Winson Chung f502e5faec Revert "Adding support for hiding widgets from the widget tray and reconfiguring widgets"
This reverts commit b29a5fa55c.

Reason for revert: Temporary revert for build.

Change-Id: I58045ad1ce28d398a5216ba4fbbcdba1196942ec
2018-03-05 18:06:52 +00:00
Sunny Goyal b29a5fa55c Adding support for hiding widgets from the widget tray and reconfiguring widgets
> Removing AppInfo target
> Switching between uninstall and setup based on the drag view

Bug: 63931362
Change-Id: Iccd6f965fa3d61992244a365efc242122292c0ca
2018-03-02 13:20:09 -08:00
Sunny Goyal 05f30889d6 Adding support for DB downgrade
Adding a schema file for handling DB downgrade. This schema file is part of
the backup/restore set, and hence is available on a device with lower app version.

Bug: 37257575
Change-Id: I69c8ef5f28d5209be6e6679412c7459d4eeda5d0
2017-05-09 12:59:04 -07:00
Sunny Goyal c65a0085d7 Adding support for showing the widget preview based on the provided RemoteViews
Bug: 35811129
Change-Id: I336e48cd00cfec2e617ac73bd8a81419b0944aa7
2017-03-17 11:25:29 -07:00
Sunny Goyal d9843357d0 Adding some tests for request pin shortcut/widget flow
Bug: 33584624
Change-Id: I49df36f60d2ae071b9d2c77c9c3300e010cd3bb9
2017-02-22 15:46:40 -08:00
Sunny Goyal 658058b960 Adding some widget addition flow tests
> Added two dummy widget providers: with config and without config
> Added tests for verify widget config flow

Change-Id: I4577f085abe8f8b82047b644c71cc9065358153a
2017-01-23 15:28:25 -08:00
Sunny Goyal 1cc1c9ad83 Enforcing background thread when accessing iconCacheDb.
> Moving any icon cache access to background thread
> Updating Apps list to avoid loading icons for ignored apps

Bug: 21325319
Change-Id: Id72755100f1176ccfcc99249c5e02873cc249a13
2017-01-10 23:42:49 -08:00
Sunny Goyal f0ba8b7ca1 Moving various runnables in LauncherModel to individual tasks
> Adding tests for some of the runnable

Change-Id: I1a315d38878857df3371f0e69d622a41fc3b081a
2016-11-09 15:50:08 -08:00
Sunny Goyal 7eab3cc374 Fixing broken instrumentation tests when run from command line
Change-Id: I923cdbaaaf18c9b765d1e70122b92cd2c1621e06
2016-03-18 17:48:53 -07:00
Hyunyoung Song 61e3a972e7 Add dummy string to Launcher3Tests resources to fix build error.
TL;DR;; since ag/656186 which moved the all-makefiles-under call to the bottom
of the launcher's Android.mk file, resources for test package
will not build without a dummy file. This change is necessary for the
test team to continuously run the android tests.

b/19566571

Change-Id: I4ff422ac019df4447348d953c5dd606d2a0dcc58
2015-03-16 17:23:58 -07:00