diff --git a/wlauto/workloads/geekbench/__init__.py b/wlauto/workloads/geekbench/__init__.py index d9eccf41..5b10ce2b 100644 --- a/wlauto/workloads/geekbench/__init__.py +++ b/wlauto/workloads/geekbench/__init__.py @@ -97,6 +97,8 @@ class Geekbench(AndroidUiAutoBenchmark): 'manually later.')), ] + is_corporate = False + @property def activity(self): return self.versions[self.version]['activity'] @@ -109,6 +111,7 @@ class Geekbench(AndroidUiAutoBenchmark): super(Geekbench, self).__init__(device, **kwargs) self.uiauto_params['version'] = self.version self.uiauto_params['times'] = self.times + self.uiauto_params['is_corporate'] = self.is_corporate self.run_timeout = self.timeout * self.times self.exact_apk_version = self.version @@ -384,6 +387,22 @@ class GBScoreCalculator(object): context.result.add_metric('Geekbench Score', int(overall_score)) +class GeekbenchCorproate(Geekbench): + name = "geekbench-corporate" + is_corporate = True + + versions = ['4.1.0'] + + # The activity name for this version doesn't match the package name + activity = 'com.primatelabs.geekbench.HomeActivity' + package = 'com.primatelabs.geekbench4.corporate' + + parameters = [ + Parameter('version', + default=sorted(versions)[-1], allowed_values=versions, + override=True) + ] + def namemify(basename, i): return basename + (' {}'.format(i) if i else '') diff --git a/wlauto/workloads/geekbench/com.arm.wlauto.uiauto.geekbench.apk b/wlauto/workloads/geekbench/com.arm.wlauto.uiauto.geekbench.apk index 3575c9b0..dcf4588d 100644 Binary files a/wlauto/workloads/geekbench/com.arm.wlauto.uiauto.geekbench.apk and b/wlauto/workloads/geekbench/com.arm.wlauto.uiauto.geekbench.apk differ diff --git a/wlauto/workloads/geekbench/uiauto/app/src/main/java/com/arm/wlauto/uiauto/geekbench/UiAutomation.java b/wlauto/workloads/geekbench/uiauto/app/src/main/java/com/arm/wlauto/uiauto/geekbench/UiAutomation.java index df9bd5ed..e1777afb 100644 --- a/wlauto/workloads/geekbench/uiauto/app/src/main/java/com/arm/wlauto/uiauto/geekbench/UiAutomation.java +++ b/wlauto/workloads/geekbench/uiauto/app/src/main/java/com/arm/wlauto/uiauto/geekbench/UiAutomation.java @@ -47,9 +47,11 @@ public void runUiAutomation() throws Exception { String[] version = params.getString("version").split("\\."); int majorVersion = Integer.parseInt(version[0]); int minorVersion = Integer.parseInt(version[1]); + boolean isCorporate = params.getBoolean("is_corporate"); int times = params.getInt("times"); - dismissEula(); + if (!isCorporate) + dismissEula(); for (int i = 0; i < times; i++) { switch (majorVersion) { @@ -74,7 +76,7 @@ public void runUiAutomation() throws Exception { } break; case 4: - runCpuBenchmarks(); + runCpuBenchmarks(isCorporate); waitForResultsv3onwards(); break; default : @@ -112,12 +114,14 @@ public void runUiAutomation() throws Exception { runButton.click(); } - public void runCpuBenchmarks() throws Exception { + public void runCpuBenchmarks(boolean isCorporate) throws Exception { // The run button is at the bottom of the view and may be off the screen so swipe to be sure uiDeviceSwipe(Direction.DOWN, 50); + String packageName = isCorporate ? "com.primatelabs.geekbench4.corporate" + : "com.primatelabs.geekbench"; UiObject runButton = - mDevice.findObject(new UiSelector().resourceId("com.primatelabs.geekbench:id/runCpuBenchmarks") + mDevice.findObject(new UiSelector().resourceId(packageName + ":id/runCpuBenchmarks") .className("android.widget.Button")); if (!runButton.waitForExists(WAIT_TIMEOUT_5SEC)) { throw new UiObjectNotFoundException("Could not find Run button"); @@ -135,7 +139,7 @@ public void runUiAutomation() throws Exception { public void waitForResultsv3onwards() throws Exception { UiSelector selector = new UiSelector(); - UiObject runningTextView = mDevice.findObject(selector.text("Running Benchmarks...") + UiObject runningTextView = mDevice.findObject(selector.textContains("Running") .className("android.widget.TextView")); if (!runningTextView.waitUntilGone(WAIT_TIMEOUT_20MIN)) {