Improve mouse handling in DragStartHelper

Ignoring ACTION_MOVE events not caused by an actual
mouse move (such as secondary button press).

Ensuring that OnDragStart is not called repeatedly
after it has returned true.

Adding tests for all major use cases.

Bug: 29570793
Test: android.support.v13.view.DragStartHelperTest
Change-Id: I457e8cd4f32ae6ad3f3b7de443e456e60ca755d5
diff --git a/v13/build.gradle b/v13/build.gradle
index 5e1a026..694d767 100644
--- a/v13/build.gradle
+++ b/v13/build.gradle
@@ -4,6 +4,16 @@
 dependencies {
     compile project(':support-annotations')
     compile project(':support-v4')
+
+    androidTestCompile ("com.android.support.test:runner:${project.rootProject.ext.testRunnerVersion}") {
+        exclude module: 'support-annotations'
+    }
+    androidTestCompile ("com.android.support.test.espresso:espresso-core:${project.rootProject.ext.espressoVersion}") {
+        exclude module: 'support-annotations'
+    }
+    androidTestCompile "org.mockito:mockito-core:1.9.5"
+    androidTestCompile "com.google.dexmaker:dexmaker:1.2"
+    androidTestCompile "com.google.dexmaker:dexmaker-mockito:1.2"
 }
 
 android {
@@ -11,6 +21,7 @@
 
     defaultConfig {
         minSdkVersion 13
+        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
     }
 
     sourceSets {
@@ -23,6 +34,11 @@
                 'api25',
                 'java'
         ]
+
+        androidTest.setRoot('tests')
+        androidTest.java.srcDir 'tests/java'
+        androidTest.res.srcDir 'tests/res'
+        androidTest.manifest.srcFile 'tests/AndroidManifest.xml'
     }
 
     lintOptions {