mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-07 13:41:24 +00:00
Minor code maintenance for base class BaseUiAutomation
- Rename inconsistently named variables - Avoid long wrapped lines where possible - Fix whitespace around operators
This commit is contained in:
parent
ee7c04a568
commit
0388fa6f36
@ -86,10 +86,10 @@ public class BaseUiAutomation extends UiAutomatorTestCase {
|
||||
|
||||
public boolean takeScreenshot(String name) {
|
||||
Bundle params = getParams();
|
||||
String png_dir = params.getString("workdir");
|
||||
String pngDir = params.getString("workdir");
|
||||
|
||||
try {
|
||||
return getUiDevice().takeScreenshot(new File(png_dir, name + ".png"));
|
||||
return getUiDevice().takeScreenshot(new File(pngDir, name + ".png"));
|
||||
} catch (NoSuchMethodError e) {
|
||||
return true;
|
||||
}
|
||||
@ -101,9 +101,9 @@ public class BaseUiAutomation extends UiAutomatorTestCase {
|
||||
|
||||
public void waitText(String text, int second) throws UiObjectNotFoundException {
|
||||
UiSelector selector = new UiSelector();
|
||||
UiObject text_obj = new UiObject(selector.text(text)
|
||||
UiObject textObj = new UiObject(selector.text(text)
|
||||
.className("android.widget.TextView"));
|
||||
waitObject(text_obj, second);
|
||||
waitObject(textObj, second);
|
||||
}
|
||||
|
||||
public void waitObject(UiObject obj) throws UiObjectNotFoundException {
|
||||
@ -152,7 +152,8 @@ public class BaseUiAutomation extends UiAutomatorTestCase {
|
||||
process.destroy();
|
||||
|
||||
if ((currentTime - startTime) >= timeout) {
|
||||
throw new TimeoutException("Timed out waiting for Logcat text \"%s\"".format(searchText));
|
||||
throw new TimeoutException(String.format("Timed out waiting for Logcat text \"%s\"",
|
||||
searchText));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user