public static class A11yTest.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder(android.content.Context context,
A11yNodeInfo nodeInfo)
The only required elements for an accessibility tests are a context and the
node info you want to test.
|
Builder(android.content.Context context,
android.view.accessibility.AccessibilityNodeInfo nodeInfo)
Convenience initializer that takes an AccessibilityNodeInfo instead.
|
Modifier and Type | Method and Description |
---|---|
A11yTest.Builder |
addRule(java.lang.Class<? extends Rule> clazz)
Add a single rule.
|
A11yTest |
build()
Build the test.
|
A11yTest.Builder |
removeRule(java.lang.Class<? extends Rule> clazz)
Remove a specific rule class from the test.
|
A11yTest.Builder |
setRules(java.lang.Class<? extends Rule>[] rules)
Changes the rules that will be run for the test.
|
A11yTest.Builder |
setRules(java.lang.Iterable<java.lang.Class<? extends Rule>> rules)
Changes the rules that will be run for the test.
|
A11yTest.Builder |
setRules(Rule.RuleSet ruleSet)
Changes the rules that will be run for the test.
|
public Builder(android.content.Context context, A11yNodeInfo nodeInfo)
context
- The activity or application context that the rules will run against.nodeInfo
- The wrapped root AccessibilityNodeInfo or AccessibilityNodeInfoCompat to test.public Builder(android.content.Context context, android.view.accessibility.AccessibilityNodeInfo nodeInfo)
context
- The activity or application context that the rules will run against.nodeInfo
- The root AccessibilityNodeInfo or AccessibilityNodeInfoCompat to test.public A11yTest.Builder setRules(java.lang.Iterable<java.lang.Class<? extends Rule>> rules)
rules
- An iterable list of rule classes to test against.public A11yTest.Builder setRules(Rule.RuleSet ruleSet)
ruleSet
- One of our prebuilt rule sets.public A11yTest.Builder setRules(java.lang.Class<? extends Rule>[] rules)
rules
- An array of rule classes to test against.public A11yTest.Builder addRule(java.lang.Class<? extends Rule> clazz)
clazz
- The class of the rule to be added.public A11yTest.Builder removeRule(java.lang.Class<? extends Rule> clazz)
clazz
- The class of the rule to remove.public A11yTest build()