summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-03-18 17:42:55 -0700
committerSunny Goyal <sunnygoyal@google.com>2016-03-18 17:48:53 -0700
commit7eab3cc374aeaaa6e305a3f583901da9844dfe08 (patch)
tree6a91a9e7dbcc3df87ea8852cadb2271623444cc4 /tests
parentb8f00da8deec7f65002830261042da0140cbead0 (diff)
downloadandroid_packages_apps_Trebuchet-7eab3cc374aeaaa6e305a3f583901da9844dfe08.tar.gz
android_packages_apps_Trebuchet-7eab3cc374aeaaa6e305a3f583901da9844dfe08.tar.bz2
android_packages_apps_Trebuchet-7eab3cc374aeaaa6e305a3f583901da9844dfe08.zip
Fixing broken instrumentation tests when run from command line
Change-Id: I923cdbaaaf18c9b765d1e70122b92cd2c1621e06
Diffstat (limited to 'tests')
-rw-r--r--tests/Android.mk3
-rw-r--r--tests/AndroidManifest.xml6
-rw-r--r--tests/res/values/string.xml21
-rw-r--r--tests/src/com/android/launcher3/BindWidgetTest.java3
-rw-r--r--tests/src/com/android/launcher3/util/TestLauncherProvider.java3
5 files changed, 8 insertions, 28 deletions
diff --git a/tests/Android.mk b/tests/Android.mk
index d82f0b35c..0c4b5ff1f 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -16,13 +16,10 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
-src_dirs := src
LOCAL_MODULE_TAGS := tests
LOCAL_STATIC_JAVA_LIBRARIES := android-support-test ub-uiautomator
LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dirs))
-LOCAL_AAPT_FLAGS := --auto-add-overlay
LOCAL_SDK_VERSION := 23
diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml
index 8acc5e90c..afe895297 100644
--- a/tests/AndroidManifest.xml
+++ b/tests/AndroidManifest.xml
@@ -20,12 +20,14 @@
<uses-sdk tools:overrideLibrary="android.support.test.uiautomator.v18"/>
- <application>
+ <application android:debuggable="true">
<uses-library android:name="android.test.runner" />
</application>
<instrumentation
- android:name="android.test.InstrumentationTestRunner"
+ android:functionalTest="false"
+ android:handleProfiling="false"
+ android:name="android.support.test.runner.AndroidJUnitRunner"
android:targetPackage="com.android.launcher3" >
</instrumentation>
</manifest>
diff --git a/tests/res/values/string.xml b/tests/res/values/string.xml
deleted file mode 100644
index 3c1ec5c61..000000000
--- a/tests/res/values/string.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<!-- Copyright (C) 2015 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-
- <!-- Dummy string for tests. [DO NOT TRANSLATE] -->
- <string name="dummy" >Dummy string for tests.</string>
-
-</resources>
diff --git a/tests/src/com/android/launcher3/BindWidgetTest.java b/tests/src/com/android/launcher3/BindWidgetTest.java
index 06e193640..4e8881cf0 100644
--- a/tests/src/com/android/launcher3/BindWidgetTest.java
+++ b/tests/src/com/android/launcher3/BindWidgetTest.java
@@ -109,7 +109,7 @@ public class BindWidgetTest extends InstrumentationTestCase {
public void testUnboundWidget_removed() throws Exception {
LauncherAppWidgetProviderInfo info = findWidgetProvider(false);
LauncherAppWidgetInfo item = createWidgetInfo(info, false);
- item.appWidgetId = 33;
+ item.appWidgetId = -33;
// Since there is no widget to verify, just wait until the workspace is ready.
setupAndVerifyContents(item, Workspace.class, null);
@@ -253,6 +253,7 @@ public class BindWidgetTest extends InstrumentationTestCase {
runTestOnUiThread(new Runnable() {
@Override
public void run() {
+ LauncherClings.markFirstRunClingDismissed(mTargetContext);
ManagedProfileHeuristic.markExistingUsersForNoFolderCreation(mTargetContext);
LauncherAppState.getInstance().getModel().resetLoadedState(true, true);
}
diff --git a/tests/src/com/android/launcher3/util/TestLauncherProvider.java b/tests/src/com/android/launcher3/util/TestLauncherProvider.java
index aef3240ca..a11013ffe 100644
--- a/tests/src/com/android/launcher3/util/TestLauncherProvider.java
+++ b/tests/src/com/android/launcher3/util/TestLauncherProvider.java
@@ -26,7 +26,8 @@ public class TestLauncherProvider extends LauncherProvider {
private static class MyDatabaseHelper extends DatabaseHelper {
public MyDatabaseHelper(Context context, LauncherProvider provider) {
- super(context, provider, null);
+ super(context, provider, null, null);
+ initIds();
}
@Override