diff --git a/wlauto/common/android/BaseUiAutomation$1.class b/wlauto/common/android/BaseUiAutomation$1.class new file mode 100644 index 00000000..fea7e68c Binary files /dev/null and b/wlauto/common/android/BaseUiAutomation$1.class differ diff --git a/wlauto/common/android/BaseUiAutomation$ActionLogger.class b/wlauto/common/android/BaseUiAutomation$ActionLogger.class new file mode 100644 index 00000000..581e1e8b Binary files /dev/null and b/wlauto/common/android/BaseUiAutomation$ActionLogger.class differ diff --git a/wlauto/common/android/BaseUiAutomation$Direction.class b/wlauto/common/android/BaseUiAutomation$Direction.class new file mode 100644 index 00000000..779a5393 Binary files /dev/null and b/wlauto/common/android/BaseUiAutomation$Direction.class differ diff --git a/wlauto/common/android/BaseUiAutomation$FindByCriteria.class b/wlauto/common/android/BaseUiAutomation$FindByCriteria.class new file mode 100644 index 00000000..97c94868 Binary files /dev/null and b/wlauto/common/android/BaseUiAutomation$FindByCriteria.class differ diff --git a/wlauto/common/android/BaseUiAutomation$PinchType.class b/wlauto/common/android/BaseUiAutomation$PinchType.class new file mode 100644 index 00000000..19a2ab46 Binary files /dev/null and b/wlauto/common/android/BaseUiAutomation$PinchType.class differ diff --git a/wlauto/common/android/BaseUiAutomation$ScreenOrientation.class b/wlauto/common/android/BaseUiAutomation$ScreenOrientation.class new file mode 100644 index 00000000..812f1a4e Binary files /dev/null and b/wlauto/common/android/BaseUiAutomation$ScreenOrientation.class differ diff --git a/wlauto/common/android/UxPerfUiAutomation$1.class b/wlauto/common/android/UxPerfUiAutomation$1.class new file mode 100644 index 00000000..bf2abb92 Binary files /dev/null and b/wlauto/common/android/UxPerfUiAutomation$1.class differ diff --git a/wlauto/common/android/UxPerfUiAutomation$ActionLogger.class b/wlauto/common/android/UxPerfUiAutomation$ActionLogger.class new file mode 100644 index 00000000..a8ea0822 Binary files /dev/null and b/wlauto/common/android/UxPerfUiAutomation$ActionLogger.class differ diff --git a/wlauto/common/android/UxPerfUiAutomation$Direction.class b/wlauto/common/android/UxPerfUiAutomation$Direction.class new file mode 100644 index 00000000..5f9bf7ed Binary files /dev/null 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..d793d013 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 new file mode 100644 index 00000000..8cc30f68 Binary files /dev/null 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 new file mode 100644 index 00000000..b4b09cda Binary files /dev/null and b/wlauto/common/android/UxPerfUiAutomation$PinchType.class differ diff --git a/wlauto/common/android/UxPerfUiAutomation$SurfaceLogger.class b/wlauto/common/android/UxPerfUiAutomation$SurfaceLogger.class new file mode 100644 index 00000000..eadfd270 Binary files /dev/null and b/wlauto/common/android/UxPerfUiAutomation$SurfaceLogger.class differ diff --git a/wlauto/common/android/UxPerfUiAutomation$Timer.class b/wlauto/common/android/UxPerfUiAutomation$Timer.class new file mode 100644 index 00000000..da53c682 Binary files /dev/null and b/wlauto/common/android/UxPerfUiAutomation$Timer.class differ diff --git a/wlauto/common/android/UxPerfUiAutomation$UxPerfLogger.class b/wlauto/common/android/UxPerfUiAutomation$UxPerfLogger.class new file mode 100644 index 00000000..67fa402b Binary files /dev/null and b/wlauto/common/android/UxPerfUiAutomation$UxPerfLogger.class differ diff --git a/wlauto/common/android/UxPerfUiAutomation.class b/wlauto/common/android/UxPerfUiAutomation.class new file mode 100644 index 00000000..1be53c1f Binary files /dev/null and b/wlauto/common/android/UxPerfUiAutomation.class differ diff --git a/wlauto/common/android/workload.py b/wlauto/common/android/workload.py index 71502ebf..21ce3d56 100644 --- a/wlauto/common/android/workload.py +++ b/wlauto/common/android/workload.py @@ -24,7 +24,7 @@ from wlauto.core.resource import NO_ONE from wlauto.common.android.resources import ApkFile from wlauto.common.resources import ExtensionAsset, Executable from wlauto.exceptions import WorkloadError, ResourceError, ConfigError, DeviceError -from wlauto.utils.android import ApkInfo, ANDROID_NORMAL_PERMISSIONS +from wlauto.utils.android import ApkInfo, ANDROID_NORMAL_PERMISSIONS, UNSUPPORTED_PACKAGES from wlauto.utils.types import boolean from wlauto.utils.revent import ReventParser from wlauto import File @@ -428,6 +428,11 @@ class AndroidUiAutoBenchmark(UiAutomatorWorkload, AndroidBenchmark): UiAutomatorWorkload.__init__(self, device, **kwargs) AndroidBenchmark.__init__(self, device, _call_super=False, **kwargs) + def initialize(self, context): + UiAutomatorWorkload.initialize(self, context) + AndroidBenchmark.initialize(self, context) + self._check_unsupported_packages() + def init_resources(self, context): UiAutomatorWorkload.init_resources(self, context) AndroidBenchmark.init_resources(self, context) @@ -444,6 +449,24 @@ class AndroidUiAutoBenchmark(UiAutomatorWorkload, AndroidBenchmark): UiAutomatorWorkload.teardown(self, context) AndroidBenchmark.teardown(self, context) + def _check_unsupported_packages(self): + """ + Check for any unsupported package versions and raise an + exception if detected. + + """ + for package in UNSUPPORTED_PACKAGES: + version = self.device.get_installed_package_version(package) + if version is None: + continue + + if '-' in version: + version = version.split('-')[0] # ignore abi version + + if version in UNSUPPORTED_PACKAGES[package]: + message = 'This workload does not support version "{}" of package "{}"' + raise WorkloadError(message.format(version, package)) + class GameWorkload(ApkWorkload, ReventWorkload): """ diff --git a/wlauto/external/uiauto/build.sh b/wlauto/external/uiauto/build.sh index 074f245a..95f9872f 100755 --- a/wlauto/external/uiauto/build.sh +++ b/wlauto/external/uiauto/build.sh @@ -16,6 +16,12 @@ +# Build and return appropriate exit code if failed ant build +exit_code=$? +if [ $exit_code -ne 0 ]; then + echo "ERROR: 'ant build' exited with code $exit_code" + exit $exit_code +fi -cp bin/classes/com/arm/wlauto/uiauto/BaseUiAutomation.class ../../common/android +cp bin/classes/com/arm/wlauto/uiauto/*.class ../../common/android diff --git a/wlauto/external/uiauto/src/com/arm/wlauto/uiauto/BaseUiAutomation.java b/wlauto/external/uiauto/src/com/arm/wlauto/uiauto/BaseUiAutomation.java index dbf0bfe5..772cea5a 100644 --- a/wlauto/external/uiauto/src/com/arm/wlauto/uiauto/BaseUiAutomation.java +++ b/wlauto/external/uiauto/src/com/arm/wlauto/uiauto/BaseUiAutomation.java @@ -84,7 +84,7 @@ public class BaseUiAutomation extends UiAutomatorTestCase { public ActionLogger(String testTag, Bundle parameters) { this.testTag = testTag; - this.enabled = Boolean.parseBoolean(parameters.getString("dumpsys_enabled")); + this.enabled = Boolean.parseBoolean(parameters.getString("markers_enabled")); } public void start() { diff --git a/wlauto/external/uiauto/src/com/arm/wlauto/uiauto/UxPerfUiAutomation.java b/wlauto/external/uiauto/src/com/arm/wlauto/uiauto/UxPerfUiAutomation.java new file mode 100644 index 00000000..10367015 --- /dev/null +++ b/wlauto/external/uiauto/src/com/arm/wlauto/uiauto/UxPerfUiAutomation.java @@ -0,0 +1,49 @@ +/* Copyright 2013-2016 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +package com.arm.wlauto.uiauto; + +import java.util.logging.Logger; + +public class UxPerfUiAutomation extends BaseUiAutomation { + + private Logger logger = Logger.getLogger(UxPerfUiAutomation.class.getName()); + + public enum GestureType { UIDEVICE_SWIPE, UIOBJECT_SWIPE, PINCH }; + + public static class GestureTestParams { + public GestureType gestureType; + public Direction gestureDirection; + public PinchType pinchType; + public int percent; + public int steps; + + public GestureTestParams(GestureType gesture, Direction direction, int steps) { + this.gestureType = gesture; + this.gestureDirection = direction; + this.pinchType = PinchType.NULL; + this.steps = steps; + this.percent = 0; + } + + public GestureTestParams(GestureType gesture, PinchType pinchType, int steps, int percent) { + this.gestureType = gesture; + this.gestureDirection = Direction.NULL; + this.pinchType = pinchType; + this.steps = steps; + this.percent = percent; + } + } +} diff --git a/wlauto/result_processors/uxperf.py b/wlauto/result_processors/uxperf.py index f303df30..1f974a2a 100644 --- a/wlauto/result_processors/uxperf.py +++ b/wlauto/result_processors/uxperf.py @@ -40,7 +40,7 @@ class UxPerfResultProcessor(ResultProcessor): An action represents a series of UI interactions to capture. NOTE: The UX_PERF markers are turned off by default and must be enabled in - a agenda file by setting dumpsys_enabled for the workload to true. + a agenda file by setting ``markers_enabled`` for the workload to ``True``. ''' parameters = [ @@ -123,14 +123,7 @@ class UxPerfParser(object): self.logger = logging.getLogger('UxPerfParser') # regex for matching logcat message format: - # date time PID-TID/package priority/tag: message - self.regex = re.compile(r'(?P\d{2}-\d{2})\s+' - '(?P