aboutsummaryrefslogtreecommitdiff
path: root/manualtest
diff options
context:
space:
mode:
authorKevin Jin <kjin@google.com>2015-02-12 16:35:10 -0800
committerKevin Jin <kjin@google.com>2015-02-12 19:57:40 -0800
commit88e33a2cba2eb40cd5ed098d8a49b80ee7b3c6d4 (patch)
tree0c2fcc541455b95df7aace1a9cfc658e9aac23d9 /manualtest
parent849d98cac056f0a210017ea8b95f0417d98ad7bc (diff)
downloaddroiddriver-88e33a2cba2eb40cd5ed098d8a49b80ee7b3c6d4.tar.gz
Add Gradle files for ManualDD
Change-Id: Ic96d6d0f9d2127aabb1ca3222eea03cd17e75e27
Diffstat (limited to 'manualtest')
-rw-r--r--manualtest/.classpath10
-rw-r--r--manualtest/.project33
-rw-r--r--manualtest/AndroidManifest.xml19
-rw-r--r--manualtest/BUILD63
-rw-r--r--manualtest/build.gradle40
-rw-r--r--manualtest/project.properties14
-rw-r--r--manualtest/res/.README.txt2
-rw-r--r--manualtest/settings.gradle3
-rw-r--r--manualtest/src/com/google/android/droiddriver/manualtest/ManualTest.java2
9 files changed, 55 insertions, 131 deletions
diff --git a/manualtest/.classpath b/manualtest/.classpath
deleted file mode 100644
index fe82c97..0000000
--- a/manualtest/.classpath
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="gen"/>
- <classpathentry combineaccessrules="false" exported="true" kind="src" path="/DroidDriver"/>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
- <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
- <classpathentry kind="output" path="bin/classes"/>
-</classpath>
diff --git a/manualtest/.project b/manualtest/.project
deleted file mode 100644
index 8c53fde..0000000
--- a/manualtest/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>ManualDD</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.ApkBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/manualtest/AndroidManifest.xml b/manualtest/AndroidManifest.xml
index 702627e..e628e32 100644
--- a/manualtest/AndroidManifest.xml
+++ b/manualtest/AndroidManifest.xml
@@ -1,18 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.google.android.droiddriver.manualtest"
- android:versionCode="1"
- android:versionName="1.0" >
-
- <uses-sdk
- android:minSdkVersion="7"
- android:targetSdkVersion="19" />
+ xmlns:tools="http://schemas.android.com/tools"
+ package="com.google.android.droiddriver.manualtest">
<instrumentation
android:name="com.google.android.droiddriver.runner.TestRunner"
android:targetPackage="com.google.android.droiddriver.manualtest" />
- <application>
+ <!-- Needed for Android.mk -->
+ <uses-sdk
+ android:minSdkVersion="7"
+ android:targetSdkVersion="19"
+ tools:ignore="OldTargetApi,GradleOverrides" />
+
+ <application
+ android:allowBackup="false"
+ tools:ignore="MissingApplicationIcon">
<uses-library android:name="android.test.runner" />
</application>
diff --git a/manualtest/BUILD b/manualtest/BUILD
deleted file mode 100644
index 8c5411e..0000000
--- a/manualtest/BUILD
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# Description:
-# Tests for DroidDriver test framework
-
-licenses(["notice"]) # Apache License 2.0, Google-owned
-
-filegroup(
- name = "opensource_filegroup",
- srcs = glob(["src/**/*.java"]) + ["AndroidManifest.xml"],
- visibility = ["//third_party/java_src/android_libs/droiddriver/opensource:__pkg__"],
-)
-
-android_resources(
- name = "resources",
- custom_package = "com.google.android.apps.common.testing.ui.testapp.tests",
- inline_constants = 0,
- manifest = "AndroidManifest.xml",
- resources = glob(["res/**"]),
- resources_dir = "res",
-)
-
-android_library(
- name = "resource_compiletime",
- srcs = [":resources"],
- neverlink = 1,
-)
-
-# Common android test library, containing:
-# project under test library and resources compile-time targets, and
-# test project dependencies.
-android_library(
- name = "test_lib",
- srcs = [":resources"],
- resources = ":resources",
- deps = [
- "//third_party/java/android_libs/droiddriver",
- "//third_party/java_src/android_libs/droiddriver/samples/testapp:test_lib",
- ],
-)
-
-android_test(
- name = "LocalAttachedTests",
- size = "medium",
- srcs = glob(
- ["src/**/*.java"],
- ),
- args = [
- "--device_broker_type=LOCAL_ADB_SERVER",
- ],
- resources = ":resources",
- shard_count = 1,
- tags = [
- "local",
- "manual",
- "notap",
- ],
- # unused - actually we used whatever we're attached to.
- target_devices = ["//tools/android/emulated_devices/generic_phone:android_7_arm"],
- deps = [
- ":test_lib",
- "//third_party/java_src/android_libs/droiddriver/samples/testapp",
- ],
-)
diff --git a/manualtest/build.gradle b/manualtest/build.gradle
new file mode 100644
index 0000000..407b7a8
--- /dev/null
+++ b/manualtest/build.gradle
@@ -0,0 +1,40 @@
+//TODO: figure out how to enable breakpoints in droiddriver. Breakpoints in system (e.g. InstrumentationTestRunner) work.
+
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ // this requires Gradle 2
+ classpath 'com.android.tools.build:gradle:1.0.1'
+ }
+}
+
+// This is actually a test without an AUT (application under test).
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 21
+ buildToolsVersion '21.1.2'
+
+ defaultConfig {
+ minSdkVersion 12
+ targetSdkVersion 21
+ // Force remove the suffix '.test'
+ testApplicationId 'com.google.android.droiddriver.manualtest'
+ testInstrumentationRunner 'com.google.android.droiddriver.runner.TestRunner'
+ }
+
+ sourceSets {
+ main {
+ manifest.srcFile 'AndroidManifest.xml'
+ }
+ androidTest {
+ java.srcDirs = ['src']
+ }
+ }
+}
+
+dependencies {
+ androidTestCompile project(':droiddriver') // TODO: use droiddriver from jcenter
+}
diff --git a/manualtest/project.properties b/manualtest/project.properties
deleted file mode 100644
index 4ab1256..0000000
--- a/manualtest/project.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-19
diff --git a/manualtest/res/.README.txt b/manualtest/res/.README.txt
deleted file mode 100644
index 912f51b..0000000
--- a/manualtest/res/.README.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This file keeps eclipse happy as it doesn't seem able to create the res folder it doesn't actually need. It can be removed if the res folder ever gets real content.
-Starting the file with a dot keeps aapt (res compiler) happy.
diff --git a/manualtest/settings.gradle b/manualtest/settings.gradle
new file mode 100644
index 0000000..1c94644
--- /dev/null
+++ b/manualtest/settings.gradle
@@ -0,0 +1,3 @@
+// This is a hack that can be removed if we use droiddriver from jcenter
+include(':droiddriver')
+project(':droiddriver').projectDir = file('..')
diff --git a/manualtest/src/com/google/android/droiddriver/manualtest/ManualTest.java b/manualtest/src/com/google/android/droiddriver/manualtest/ManualTest.java
index e7e16ce..238db2e 100644
--- a/manualtest/src/com/google/android/droiddriver/manualtest/ManualTest.java
+++ b/manualtest/src/com/google/android/droiddriver/manualtest/ManualTest.java
@@ -13,7 +13,7 @@ import com.google.android.droiddriver.helpers.DroidDrivers;
* testing. Instead it is used for debugging failures. It assumes the device is
* in a condition that is ready to reproduce a failure. For example,
* {@link #testSetTextForPassword} assumes the password_edit field is displayed
- * on screen.
+ * on screen and has input focus.
* <p>
* Run it as (optionally with -e debug true)
*