mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-03-20 17:48:44 +00:00
Merge pull request #4 from jimboatarm/develop
Fixes for Reader/Gmail/Photos
This commit is contained in:
commit
44f99dcc79
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
wlauto/common/android/UxPerfUiAutomation$GestureTestParams.class
Normal file
BIN
wlauto/common/android/UxPerfUiAutomation$GestureTestParams.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -66,30 +66,29 @@ class Gmail(AndroidUiAutoBenchmark):
|
|||||||
def update_result(self, context):
|
def update_result(self, context):
|
||||||
super(Gmail, self).update_result(context)
|
super(Gmail, self).update_result(context)
|
||||||
|
|
||||||
if self.dumpsys_enabled:
|
self.device.pull_file(self.output_file, context.output_directory)
|
||||||
self.device.pull_file(self.output_file, context.output_directory)
|
result_file = os.path.join(context.output_directory, self.instrumentation_log)
|
||||||
result_file = os.path.join(context.output_directory, self.instrumentation_log)
|
|
||||||
|
|
||||||
with open(result_file, 'r') as wfh:
|
with open(result_file, 'r') as wfh:
|
||||||
regex = re.compile(r'(?P<key>\w+)\s+(?P<value1>\d+)\s+(?P<value2>\d+)\s+(?P<value3>\d+)')
|
regex = re.compile(r'(?P<key>\w+)\s+(?P<value1>\d+)\s+(?P<value2>\d+)\s+(?P<value3>\d+)')
|
||||||
for line in wfh:
|
for line in wfh:
|
||||||
match = regex.search(line)
|
match = regex.search(line)
|
||||||
if match:
|
if match:
|
||||||
context.result.add_metric((match.group('key') + "_start"),
|
context.result.add_metric((match.group('key') + "_start"),
|
||||||
match.group('value1'))
|
match.group('value1'))
|
||||||
context.result.add_metric((match.group('key') + "_finish"),
|
context.result.add_metric((match.group('key') + "_finish"),
|
||||||
match.group('value2'))
|
match.group('value2'))
|
||||||
context.result.add_metric((match.group('key') + "_duration"),
|
context.result.add_metric((match.group('key') + "_duration"),
|
||||||
match.group('value3'))
|
match.group('value3'))
|
||||||
|
|
||||||
def teardown(self, context):
|
def teardown(self, context):
|
||||||
super(Gmail, self).teardown(context)
|
super(Gmail, self).teardown(context)
|
||||||
|
|
||||||
for file in self.device.listdir(self.device.working_directory):
|
for file in self.device.listdir(self.device.working_directory):
|
||||||
if file.startswith (self.name) and file.endswith(".log"):
|
if file.endswith(".log"):
|
||||||
self.device.pull_file(os.path.join(self.device.working_directory, file), context.output_directory)
|
self.device.pull_file(os.path.join(self.device.working_directory, file), context.output_directory)
|
||||||
self.device.delete_file(os.path.join(self.device.working_directory, file))
|
self.device.delete_file(os.path.join(self.device.working_directory, file))
|
||||||
if file.startswith (self.name) and file.endswith(".jpg"):
|
if file.endswith(".jpg"):
|
||||||
self.device.delete_file(os.path.join(self.device.working_directory, file))
|
self.device.delete_file(os.path.join(self.device.working_directory, file))
|
||||||
|
|
||||||
# Force a re-index of the mediaserver cache to pick up new files
|
# Force a re-index of the mediaserver cache to pick up new files
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -20,12 +20,14 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
public static String TAG = "uxperf_googlephotos";
|
public static String TAG = "uxperf_googlephotos";
|
||||||
|
|
||||||
public Bundle parameters;
|
public Bundle parameters;
|
||||||
private long viewTimeout = TimeUnit.SECONDS.toMillis(10);
|
private int viewTimeoutSecs = 10;
|
||||||
|
private long viewTimeout = TimeUnit.SECONDS.toMillis(viewTimeoutSecs);
|
||||||
private LinkedHashMap<String, Timer> timingResults = new LinkedHashMap<String, Timer>();
|
private LinkedHashMap<String, Timer> timingResults = new LinkedHashMap<String, Timer>();
|
||||||
|
|
||||||
public void runUiAutomation() throws Exception {
|
public void runUiAutomation() throws Exception {
|
||||||
parameters = getParams();
|
parameters = getParams();
|
||||||
|
|
||||||
|
confirmLocalFileAccess();
|
||||||
dismissWelcomeView();
|
dismissWelcomeView();
|
||||||
gesturesTest();
|
gesturesTest();
|
||||||
editPhotoTest();
|
editPhotoTest();
|
||||||
@ -33,16 +35,31 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
writeResultsToFile(timingResults, parameters.getString("output_file"));
|
writeResultsToFile(timingResults, parameters.getString("output_file"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void confirmLocalFileAccess() throws Exception {
|
||||||
|
// First time run requires confirmation to allow access to local files
|
||||||
|
UiObject allowButton = new UiObject(new UiSelector().textContains("Allow")
|
||||||
|
.className("android.widget.Button"));
|
||||||
|
if (allowButton.waitForExists(timeout)) {
|
||||||
|
allowButton.clickAndWaitForNewWindow(timeout);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void dismissWelcomeView() throws Exception {
|
private void dismissWelcomeView() throws Exception {
|
||||||
|
|
||||||
// Click through the first two pages and make sure that we don't sign
|
// Click through the first two pages and make sure that we don't sign
|
||||||
// in to our google account. This ensures the same set of photographs
|
// in to our google account. This ensures the same set of photographs
|
||||||
// are placed in the camera directory for each run.
|
// are placed in the camera directory for each run.
|
||||||
|
|
||||||
sleep(3); // Pause while splash screen loads
|
sleep(5); // Pause while splash screen loads
|
||||||
|
|
||||||
UiObject getStartedButton =
|
UiObject getStartedButton =
|
||||||
getUiObjectByResourceId("com.google.android.apps.photos:id/get_started",
|
new UiObject (new UiSelector().textContains("Get started")
|
||||||
"android.widget.Button");
|
.className("android.widget.Button"));
|
||||||
|
|
||||||
|
tapDisplayCentre();
|
||||||
|
waitObject(getStartedButton, 10);
|
||||||
|
|
||||||
getStartedButton.clickAndWaitForNewWindow();
|
getStartedButton.clickAndWaitForNewWindow();
|
||||||
|
|
||||||
UiObject welcomeButton =
|
UiObject welcomeButton =
|
||||||
@ -78,7 +95,6 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
testParams.put("pinch_out", new GestureTestParams(GestureType.PINCH, PinchType.OUT, 100, 50));
|
testParams.put("pinch_out", new GestureTestParams(GestureType.PINCH, PinchType.OUT, 100, 50));
|
||||||
testParams.put("pinch_in", new GestureTestParams(GestureType.PINCH, PinchType.IN, 100, 50));
|
testParams.put("pinch_in", new GestureTestParams(GestureType.PINCH, PinchType.IN, 100, 50));
|
||||||
testParams.put("swipe_right", new GestureTestParams(GestureType.UIDEVICE_SWIPE, Direction.RIGHT, 10));
|
testParams.put("swipe_right", new GestureTestParams(GestureType.UIDEVICE_SWIPE, Direction.RIGHT, 10));
|
||||||
testParams.put("swipe_up", new GestureTestParams(GestureType.UIDEVICE_SWIPE, Direction.UP, 10));
|
|
||||||
|
|
||||||
Iterator<Entry<String, GestureTestParams>> it = testParams.entrySet().iterator();
|
Iterator<Entry<String, GestureTestParams>> it = testParams.entrySet().iterator();
|
||||||
|
|
||||||
@ -128,6 +144,10 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
|
|
||||||
timingResults.put(runName, results);
|
timingResults.put(runName, results);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UiObject navigateUpButton =
|
||||||
|
getUiObjectByDescription("Navigate Up", "android.widget.ImageButton");
|
||||||
|
navigateUpButton.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void editPhotoTest() throws Exception {
|
private void editPhotoTest() throws Exception {
|
||||||
|
@ -65,21 +65,20 @@ class Reader(AndroidUiAutoBenchmark):
|
|||||||
def update_result(self, context):
|
def update_result(self, context):
|
||||||
super(Reader, self).update_result(context)
|
super(Reader, self).update_result(context)
|
||||||
|
|
||||||
if self.dumpsys_enabled:
|
self.device.pull_file(self.output_file, context.output_directory)
|
||||||
self.device.pull_file(self.output_file, context.output_directory)
|
result_file = os.path.join(context.output_directory, self.instrumentation_log)
|
||||||
result_file = os.path.join(context.output_directory, self.instrumentation_log)
|
|
||||||
|
|
||||||
with open(result_file, 'r') as wfh:
|
with open(result_file, 'r') as wfh:
|
||||||
regex = re.compile(r'(?P<key>\w+)\s+(?P<value1>\d+)\s+(?P<value2>\d+)\s+(?P<value3>\d+)')
|
regex = re.compile(r'(?P<key>\w+)\s+(?P<value1>\d+)\s+(?P<value2>\d+)\s+(?P<value3>\d+)')
|
||||||
for line in wfh:
|
for line in wfh:
|
||||||
match = regex.search(line)
|
match = regex.search(line)
|
||||||
if match:
|
if match:
|
||||||
context.result.add_metric((match.group('key') + "_start"),
|
context.result.add_metric((match.group('key') + "_start"),
|
||||||
match.group('value1'))
|
match.group('value1'))
|
||||||
context.result.add_metric((match.group('key') + "_finish"),
|
context.result.add_metric((match.group('key') + "_finish"),
|
||||||
match.group('value2'))
|
match.group('value2'))
|
||||||
context.result.add_metric((match.group('key') + "_duration"),
|
context.result.add_metric((match.group('key') + "_duration"),
|
||||||
match.group('value3'))
|
match.group('value3'))
|
||||||
|
|
||||||
def teardown(self, context):
|
def teardown(self, context):
|
||||||
super(Reader, self).teardown(context)
|
super(Reader, self).teardown(context)
|
||||||
@ -88,6 +87,6 @@ class Reader(AndroidUiAutoBenchmark):
|
|||||||
self.device.delete_file(os.path.join(self.reader_local_dir, file))
|
self.device.delete_file(os.path.join(self.reader_local_dir, file))
|
||||||
|
|
||||||
for file in self.device.listdir(self.device.working_directory):
|
for file in self.device.listdir(self.device.working_directory):
|
||||||
if file.startswith (self.name) and file.endswith(".log"):
|
if file.endswith(".log"):
|
||||||
self.device.pull_file(os.path.join(self.device.working_directory, file), context.output_directory)
|
self.device.pull_file(os.path.join(self.device.working_directory, file), context.output_directory)
|
||||||
self.device.delete_file(os.path.join(self.device.working_directory, file))
|
self.device.delete_file(os.path.join(self.device.working_directory, file))
|
||||||
|
Binary file not shown.
@ -227,7 +227,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
int percent = pair.getValue().percent;
|
int percent = pair.getValue().percent;
|
||||||
|
|
||||||
String runName = String.format(TestTag + "_" + pair.getKey());
|
String runName = String.format(TestTag + "_" + pair.getKey());
|
||||||
String gfxInfologName = String.format(TAG + "_" + runName + "_gfxInfo.log");
|
String gfxInfologName = String.format(runName + "_gfxInfo.log");
|
||||||
String surfFlingerlogName = String.format(runName + "_surfFlinger.log");
|
String surfFlingerlogName = String.format(runName + "_surfFlinger.log");
|
||||||
String viewName = new String("com.adobe.reader.viewer.ARViewerActivity");
|
String viewName = new String("com.adobe.reader.viewer.ARViewerActivity");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user