diff --git a/wlauto/common/android/BaseUiAutomation.class b/wlauto/common/android/BaseUiAutomation.class index e7aca274..168228ae 100644 Binary files a/wlauto/common/android/BaseUiAutomation.class and b/wlauto/common/android/BaseUiAutomation.class differ diff --git a/wlauto/common/android/UxPerfUiAutomation$1.class b/wlauto/common/android/UxPerfUiAutomation$1.class index 30a97eb3..68c6d755 100644 Binary files a/wlauto/common/android/UxPerfUiAutomation$1.class and b/wlauto/common/android/UxPerfUiAutomation$1.class differ diff --git a/wlauto/common/android/UxPerfUiAutomation$Direction.class b/wlauto/common/android/UxPerfUiAutomation$Direction.class index a3b7eb4e..e7808a1f 100644 Binary files a/wlauto/common/android/UxPerfUiAutomation$Direction.class and b/wlauto/common/android/UxPerfUiAutomation$Direction.class differ diff --git a/wlauto/common/android/UxPerfUiAutomation$GestureTestParams.class b/wlauto/common/android/UxPerfUiAutomation$GestureTestParams.class new file mode 100644 index 00000000..3f074e63 Binary files /dev/null and b/wlauto/common/android/UxPerfUiAutomation$GestureTestParams.class differ diff --git a/wlauto/common/android/UxPerfUiAutomation$GestureType.class b/wlauto/common/android/UxPerfUiAutomation$GestureType.class index 5e9e2410..7651f530 100644 Binary files a/wlauto/common/android/UxPerfUiAutomation$GestureType.class and b/wlauto/common/android/UxPerfUiAutomation$GestureType.class differ diff --git a/wlauto/common/android/UxPerfUiAutomation$PinchType.class b/wlauto/common/android/UxPerfUiAutomation$PinchType.class index b1368c08..1ee135ef 100644 Binary files a/wlauto/common/android/UxPerfUiAutomation$PinchType.class and b/wlauto/common/android/UxPerfUiAutomation$PinchType.class differ diff --git a/wlauto/common/android/UxPerfUiAutomation$Timer.class b/wlauto/common/android/UxPerfUiAutomation$Timer.class index 4babd8ee..3926a1ea 100644 Binary files a/wlauto/common/android/UxPerfUiAutomation$Timer.class and b/wlauto/common/android/UxPerfUiAutomation$Timer.class differ diff --git a/wlauto/common/android/UxPerfUiAutomation.class b/wlauto/common/android/UxPerfUiAutomation.class index ccd5d115..03ce92db 100644 Binary files a/wlauto/common/android/UxPerfUiAutomation.class and b/wlauto/common/android/UxPerfUiAutomation.class differ diff --git a/wlauto/workloads/gmail/__init__.py b/wlauto/workloads/gmail/__init__.py index 78a05abe..a02646ab 100755 --- a/wlauto/workloads/gmail/__init__.py +++ b/wlauto/workloads/gmail/__init__.py @@ -66,30 +66,29 @@ class Gmail(AndroidUiAutoBenchmark): def update_result(self, context): super(Gmail, self).update_result(context) - if self.dumpsys_enabled: - self.device.pull_file(self.output_file, context.output_directory) - result_file = os.path.join(context.output_directory, self.instrumentation_log) + self.device.pull_file(self.output_file, context.output_directory) + result_file = os.path.join(context.output_directory, self.instrumentation_log) - with open(result_file, 'r') as wfh: - regex = re.compile(r'(?P\w+)\s+(?P\d+)\s+(?P\d+)\s+(?P\d+)') - for line in wfh: - match = regex.search(line) - if match: - context.result.add_metric((match.group('key') + "_start"), - match.group('value1')) - context.result.add_metric((match.group('key') + "_finish"), - match.group('value2')) - context.result.add_metric((match.group('key') + "_duration"), - match.group('value3')) + with open(result_file, 'r') as wfh: + regex = re.compile(r'(?P\w+)\s+(?P\d+)\s+(?P\d+)\s+(?P\d+)') + for line in wfh: + match = regex.search(line) + if match: + context.result.add_metric((match.group('key') + "_start"), + match.group('value1')) + context.result.add_metric((match.group('key') + "_finish"), + match.group('value2')) + context.result.add_metric((match.group('key') + "_duration"), + match.group('value3')) def teardown(self, context): super(Gmail, self).teardown(context) 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.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)) # Force a re-index of the mediaserver cache to pick up new files diff --git a/wlauto/workloads/gmail/com.arm.wlauto.uiauto.gmail.jar b/wlauto/workloads/gmail/com.arm.wlauto.uiauto.gmail.jar index 48aabdb7..1ac26c16 100644 Binary files a/wlauto/workloads/gmail/com.arm.wlauto.uiauto.gmail.jar and b/wlauto/workloads/gmail/com.arm.wlauto.uiauto.gmail.jar differ diff --git a/wlauto/workloads/googlephotos/com.arm.wlauto.uiauto.googlephotos.jar b/wlauto/workloads/googlephotos/com.arm.wlauto.uiauto.googlephotos.jar index cf790ce4..41dd7af6 100644 Binary files a/wlauto/workloads/googlephotos/com.arm.wlauto.uiauto.googlephotos.jar and b/wlauto/workloads/googlephotos/com.arm.wlauto.uiauto.googlephotos.jar differ diff --git a/wlauto/workloads/googlephotos/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/googlephotos/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index b9d9b81e..a8bd6514 100644 --- a/wlauto/workloads/googlephotos/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/googlephotos/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -20,12 +20,14 @@ public class UiAutomation extends UxPerfUiAutomation { public static String TAG = "uxperf_googlephotos"; public Bundle parameters; - private long viewTimeout = TimeUnit.SECONDS.toMillis(10); + private int viewTimeoutSecs = 10; + private long viewTimeout = TimeUnit.SECONDS.toMillis(viewTimeoutSecs); private LinkedHashMap timingResults = new LinkedHashMap(); public void runUiAutomation() throws Exception { parameters = getParams(); + confirmLocalFileAccess(); dismissWelcomeView(); gesturesTest(); editPhotoTest(); @@ -33,16 +35,31 @@ public class UiAutomation extends UxPerfUiAutomation { 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 { + // 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 // 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 = - getUiObjectByResourceId("com.google.android.apps.photos:id/get_started", - "android.widget.Button"); + new UiObject (new UiSelector().textContains("Get started") + .className("android.widget.Button")); + + tapDisplayCentre(); + waitObject(getStartedButton, 10); + getStartedButton.clickAndWaitForNewWindow(); 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_in", new GestureTestParams(GestureType.PINCH, PinchType.IN, 100, 50)); 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> it = testParams.entrySet().iterator(); @@ -128,6 +144,10 @@ public class UiAutomation extends UxPerfUiAutomation { timingResults.put(runName, results); } + + UiObject navigateUpButton = + getUiObjectByDescription("Navigate Up", "android.widget.ImageButton"); + navigateUpButton.click(); } private void editPhotoTest() throws Exception { diff --git a/wlauto/workloads/reader/__init__.py b/wlauto/workloads/reader/__init__.py index 53c6fe3d..1a29e00b 100755 --- a/wlauto/workloads/reader/__init__.py +++ b/wlauto/workloads/reader/__init__.py @@ -65,21 +65,20 @@ class Reader(AndroidUiAutoBenchmark): def update_result(self, context): super(Reader, self).update_result(context) - if self.dumpsys_enabled: - self.device.pull_file(self.output_file, context.output_directory) - result_file = os.path.join(context.output_directory, self.instrumentation_log) + self.device.pull_file(self.output_file, context.output_directory) + result_file = os.path.join(context.output_directory, self.instrumentation_log) - with open(result_file, 'r') as wfh: - regex = re.compile(r'(?P\w+)\s+(?P\d+)\s+(?P\d+)\s+(?P\d+)') - for line in wfh: - match = regex.search(line) - if match: - context.result.add_metric((match.group('key') + "_start"), - match.group('value1')) - context.result.add_metric((match.group('key') + "_finish"), - match.group('value2')) - context.result.add_metric((match.group('key') + "_duration"), - match.group('value3')) + with open(result_file, 'r') as wfh: + regex = re.compile(r'(?P\w+)\s+(?P\d+)\s+(?P\d+)\s+(?P\d+)') + for line in wfh: + match = regex.search(line) + if match: + context.result.add_metric((match.group('key') + "_start"), + match.group('value1')) + context.result.add_metric((match.group('key') + "_finish"), + match.group('value2')) + context.result.add_metric((match.group('key') + "_duration"), + match.group('value3')) def teardown(self, 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)) 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.delete_file(os.path.join(self.device.working_directory, file)) diff --git a/wlauto/workloads/reader/com.arm.wlauto.uiauto.reader.jar b/wlauto/workloads/reader/com.arm.wlauto.uiauto.reader.jar index aae22499..ba3eb3bf 100644 Binary files a/wlauto/workloads/reader/com.arm.wlauto.uiauto.reader.jar and b/wlauto/workloads/reader/com.arm.wlauto.uiauto.reader.jar differ diff --git a/wlauto/workloads/reader/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/reader/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index f2334102..5255e58e 100755 --- a/wlauto/workloads/reader/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/reader/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -227,7 +227,7 @@ public class UiAutomation extends UxPerfUiAutomation { int percent = pair.getValue().percent; 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 viewName = new String("com.adobe.reader.viewer.ARViewerActivity");