summaryrefslogtreecommitdiffstats
path: root/tests/src/com/android
diff options
context:
space:
mode:
authorvadimt <vadimt@google.com>2019-05-16 16:32:25 -0700
committervadimt <vadimt@google.com>2019-05-16 16:32:25 -0700
commitc7bb8479e9c6e86ab2172a657f60f44abafb35b5 (patch)
treeeca0b23b5878b2518a57b08201d1796dcbae1f98 /tests/src/com/android
parent5338e0540bc90e9811c5485aa33a32cd64368987 (diff)
downloadandroid_packages_apps_Trebuchet-c7bb8479e9c6e86ab2172a657f60f44abafb35b5.tar.gz
android_packages_apps_Trebuchet-c7bb8479e9c6e86ab2172a657f60f44abafb35b5.tar.bz2
android_packages_apps_Trebuchet-c7bb8479e9c6e86ab2172a657f60f44abafb35b5.zip
Fix pinning tests on android virtual device
Change-Id: I90a8753975538ab9864591a37a7d366e1222f2d8
Diffstat (limited to 'tests/src/com/android')
-rw-r--r--tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java b/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
index b66fa8afb..a57d7bab8 100644
--- a/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
+++ b/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
@@ -17,26 +17,25 @@ package com.android.launcher3.ui.widget;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertTrue;
import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.content.Intent;
import android.graphics.Color;
+import android.view.View;
+
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import androidx.test.uiautomator.By;
import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.Until;
-import android.view.View;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.LauncherAppWidgetInfo;
import com.android.launcher3.LauncherSettings.Favorites;
-import com.android.launcher3.R;
-import com.android.launcher3.WorkspaceItemInfo;
import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace.ItemOperator;
+import com.android.launcher3.WorkspaceItemInfo;
import com.android.launcher3.shortcuts.ShortcutKey;
import com.android.launcher3.testcomponent.AppWidgetNoConfig;
import com.android.launcher3.testcomponent.AppWidgetWithConfig;
@@ -49,7 +48,6 @@ import com.android.launcher3.util.rule.ShellCommandRule;
import com.android.launcher3.widget.WidgetCell;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -181,7 +179,9 @@ public class RequestPinItemTest extends AbstractLauncherUiTest {
// Accept confirmation:
BlockingBroadcastReceiver resultReceiver = new BlockingBroadcastReceiver(mCallbackAction);
- mDevice.wait(Until.findObject(By.text("Add automatically")), DEFAULT_UI_TIMEOUT).click();
+ mDevice.wait(Until.findObject(
+ By.text(mLauncher.isAvd() ? "ADD AUTOMATICALLY" : "Add automatically")),
+ DEFAULT_UI_TIMEOUT).click();
Intent result = resultReceiver.blockingGetIntent();
assertNotNull(result);
mAppWidgetId = result.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, -1);