summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorvadimt <vadimt@google.com>2019-04-04 17:35:57 -0700
committervadimt <vadimt@google.com>2019-04-04 18:45:49 -0700
commitfb0cb7a26cb2cb6835b23cd6a70c74586fced90a (patch)
tree65031e50c1985176ca7b8d92134c543f82dbce84 /tests
parent24eb1c9c89f26f2371cc26c1eaa4e647820f2f0b (diff)
downloadandroid_packages_apps_Trebuchet-fb0cb7a26cb2cb6835b23cd6a70c74586fced90a.tar.gz
android_packages_apps_Trebuchet-fb0cb7a26cb2cb6835b23cd6a70c74586fced90a.tar.bz2
android_packages_apps_Trebuchet-fb0cb7a26cb2cb6835b23cd6a70c74586fced90a.zip
Not using Settings in TaplTestsLauncher3.testDragAppIcon
Settings frequently crashes Bug: 126587956 Change-Id: Ied62d6f8783d8f0f9c434bdd8ee14c62d6cbc4c1
Diffstat (limited to 'tests')
-rw-r--r--tests/AndroidManifest-common.xml8
-rw-r--r--tests/src/com/android/launcher3/testcomponent/BaseTestingActivity.java2
-rw-r--r--tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java6
3 files changed, 12 insertions, 4 deletions
diff --git a/tests/AndroidManifest-common.xml b/tests/AndroidManifest-common.xml
index 46b463b21..089d672b1 100644
--- a/tests/AndroidManifest-common.xml
+++ b/tests/AndroidManifest-common.xml
@@ -97,5 +97,13 @@
<category android:name="android.intent.category.LAUNCHER_APP" />
</intent-filter>
</activity>
+ <activity
+ android:name="com.android.launcher3.testcomponent.BaseTestingActivity"
+ android:label="LauncherTestApp">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ </activity>
</application>
</manifest>
diff --git a/tests/src/com/android/launcher3/testcomponent/BaseTestingActivity.java b/tests/src/com/android/launcher3/testcomponent/BaseTestingActivity.java
index 904590cb8..9c6d10232 100644
--- a/tests/src/com/android/launcher3/testcomponent/BaseTestingActivity.java
+++ b/tests/src/com/android/launcher3/testcomponent/BaseTestingActivity.java
@@ -20,6 +20,7 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.graphics.Color;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.View;
@@ -63,6 +64,7 @@ public class BaseTestingActivity extends Activity implements View.OnClickListene
mView = new LinearLayout(this);
mView.setPadding(mMargin, mMargin, mMargin, mMargin);
mView.setOrientation(LinearLayout.VERTICAL);
+ mView.setBackgroundColor(Color.BLUE);
setContentView(mView);
registerReceiver(mCommandReceiver, new IntentFilter(mAction + SUFFIX_COMMAND));
diff --git a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java
index c2e6749d5..e11e62e79 100644
--- a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java
+++ b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java
@@ -330,9 +330,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
public void testDragAppIcon() throws Throwable {
try {
TestProtocol.sDebugTracing = true;
- LauncherActivityInfo settingsApp = getSettingsApp();
-
- final String appName = settingsApp.getLabel().toString();
+ final String appName = "LauncherTestApp";
// 1. Open all apps and wait for load complete.
// 2. Drag icon to homescreen.
// 3. Verify that the icon works on homescreen.
@@ -341,7 +339,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
getAppIcon(appName).
dragToWorkspace().
getWorkspaceAppIcon(appName).
- launch(settingsApp.getComponentName().getPackageName());
+ launch(getInstrumentation().getContext().getPackageName());
} finally {
TestProtocol.sDebugTracing = false;
}