Fix drag and drop test by moving a bit if there are shortcuts.

Change-Id: Icd023f5d095610b6d1aadbf455d068ce7d700768
This commit is contained in:
Tony Wickham
2016-11-14 14:14:19 -08:00
parent 14b64340ab
commit 05b20b0712
3 changed files with 33 additions and 11 deletions

View File

@@ -5,7 +5,6 @@ import android.support.test.uiautomator.UiObject2;
import android.test.suitebuilder.annotation.LargeTest;
import android.view.View;
import com.android.launcher3.CellLayout;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAppWidgetInfo;
@@ -51,7 +50,7 @@ public class AddWidgetTest extends LauncherInstrumentationTestCase {
// Drag widget to homescreen
UiObject2 widget = scrollAndFind(widgetContainer, By.clazz(WidgetCell.class)
.hasDescendant(By.text(widgetInfo.getLabel(mTargetContext.getPackageManager()))));
dragToWorkspace(widget);
dragToWorkspace(widget, false);
assertNotNull(launcher.getWorkspace().getFirstMatch(new ItemOperator() {
@Override