diff --git a/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java b/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java index 362596c1ab..405dae7c86 100644 --- a/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java +++ b/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java @@ -159,13 +159,13 @@ public class TaplUninstallRemoveTest extends AbstractLauncherUiTest { mLauncher.getWorkspace().getWorkspaceIconsPositions(); assertThat(initialPositions.keySet()).containsAtLeastElementsIn(appNames); - mLauncher.getWorkspace().getWorkspaceAppIcon(DUMMY_APP_NAME).uninstall(); - mLauncher.getWorkspace().verifyWorkspaceAppIconIsGone( + final Workspace workspace = mLauncher.getWorkspace().getWorkspaceAppIcon( + DUMMY_APP_NAME).uninstall(); + workspace.verifyWorkspaceAppIconIsGone( DUMMY_APP_NAME + " was expected to disappear after uninstall.", DUMMY_APP_NAME); Log.d(UIOBJECT_STALE_ELEMENT, "second getWorkspaceIconsPositions()"); - Map finalPositions = - mLauncher.getWorkspace().getWorkspaceIconsPositions(); + Map finalPositions = workspace.getWorkspaceIconsPositions(); assertThat(finalPositions).doesNotContainKey(DUMMY_APP_NAME); } finally { TestUtil.uninstallDummyApp();