[go: nahoru, domu]

Refactor testing APIs to the final proposal.

Bug: 161116353
Test: N/A
Relnote: "Several testing APIs were renamed to be more intuitive. All
findXYZ APIs were renamed to onNodeXYZ. All doXYZ APIs were renamed to
performXYZ."

Change-Id: I7f164b42b04196f023c4a2153d66825487998de4
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendLongClickTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendLongClickTest.kt
index 5cbd19e..2f92087 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendLongClickTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendLongClickTest.kt
@@ -25,9 +25,9 @@
 import androidx.ui.layout.fillMaxSize
 import androidx.ui.layout.wrapContentSize
 import androidx.ui.test.createComposeRule
-import androidx.ui.test.doGesture
-import androidx.ui.test.findByTag
-import androidx.ui.test.sendLongClick
+import androidx.ui.test.performGesture
+import androidx.ui.test.onNodeWithTag
+import androidx.ui.test.longClick
 import androidx.ui.test.util.ClickableTestBox
 import androidx.ui.test.util.ClickableTestBox.defaultSize
 import androidx.ui.test.util.ClickableTestBox.defaultTag
@@ -44,7 +44,7 @@
 import org.junit.runners.Parameterized
 
 /**
- * Tests [sendLongClick] with arguments. Verifies that the click is in the middle
+ * Tests [longClick] with arguments. Verifies that the click is in the middle
  * of the component, that the gesture has a duration of 600 milliseconds and that all input
  * events were on the same location.
  */
@@ -93,15 +93,15 @@
         }
 
         // When we inject a long click
-        findByTag(defaultTag).doGesture {
+        onNodeWithTag(defaultTag).performGesture {
             if (config.position != null && config.duration != null) {
-                sendLongClick(config.position, config.duration)
+                longClick(config.position, config.duration)
             } else if (config.position != null) {
-                sendLongClick(config.position)
+                longClick(config.position)
             } else if (config.duration != null) {
-                sendLongClick(duration = config.duration)
+                longClick(duration = config.duration)
             } else {
-                sendLongClick()
+                longClick()
             }
         }