本文整理汇总了Java中android.test.InstrumentationTestCase.sendKeys方法的典型用法代码示例。如果您正苦于以下问题:Java InstrumentationTestCase.sendKeys方法的具体用法?Java InstrumentationTestCase.sendKeys怎么用?Java InstrumentationTestCase.sendKeys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.test.InstrumentationTestCase
的用法示例。
在下文中一共展示了InstrumentationTestCase.sendKeys方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tapDialogNegativeButton
import android.test.InstrumentationTestCase; //导入方法依赖的package包/类
/**
* Taps the positive button of a currently displayed dialog. This method assumes that a button
* of the dialog is currently selected.
*
* @see #tapDialogNegativeButton(InstrumentationTestCase)
*/
public static void tapDialogNegativeButton(InstrumentationTestCase testCase) {
// The order of the buttons is reversed from ICS onwards
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
testCase.sendKeys("DPAD_RIGHT DPAD_CENTER");
} else {
testCase.sendKeys("DPAD_LEFT DPAD_CENTER");
}
}
示例2: tapDialogPositiveButton
import android.test.InstrumentationTestCase; //导入方法依赖的package包/类
/**
* Taps the negative button of a currently displayed dialog. This method assumes that a button
* of the dialog is currently selected.
*
* @see #tapDialogNegativeButton(InstrumentationTestCase)
*/
public static void tapDialogPositiveButton(InstrumentationTestCase testCase) {
// The order of the buttons is reversed from ICS onwards
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
testCase.sendKeys("DPAD_LEFT DPAD_CENTER");
} else {
testCase.sendKeys("DPAD_RIGHT DPAD_CENTER");
}
}
示例3: tapNegativeButtonIn3ButtonDialog
import android.test.InstrumentationTestCase; //导入方法依赖的package包/类
/**
* Taps the negative button of a currently displayed 3 button dialog. This method assumes
* that a button of the dialog is currently selected.
*/
public static void tapNegativeButtonIn3ButtonDialog(InstrumentationTestCase testCase) {
// The order of the buttons is reversed from ICS onwards
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
testCase.sendKeys("DPAD_RIGHT DPAD_RIGHT DPAD_CENTER");
} else {
testCase.sendKeys("DPAD_LEFT DPAD_LEFT DPAD_CENTER");
}
}
示例4: tapNeutralButtonIn3ButtonDialog
import android.test.InstrumentationTestCase; //导入方法依赖的package包/类
/**
* Taps the neutral button of a currently displayed 3 button dialog. This method assumes
* that a button of the dialog is currently selected.
*/
public static void tapNeutralButtonIn3ButtonDialog(InstrumentationTestCase testCase) {
// The order of the buttons is reversed from ICS onwards
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
testCase.sendKeys("DPAD_RIGHT DPAD_CENTER");
} else {
testCase.sendKeys("DPAD_RIGHT DPAD_CENTER");
}
}
示例5: tapPositiveButtonIn3ButtonDialog
import android.test.InstrumentationTestCase; //导入方法依赖的package包/类
/**
* Taps the positive button of a currently displayed 3 button dialog. This method assumes
* that a button of the dialog is currently selected.
*/
public static void tapPositiveButtonIn3ButtonDialog(InstrumentationTestCase testCase) {
// The order of the buttons is reversed from ICS onwards
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
testCase.sendKeys("DPAD_LEFT DPAD_LEFT DPAD_CENTER");
} else {
testCase.sendKeys("DPAD_RIGHT DPAD_RIGHT DPAD_CENTER");
}
}