diff --git a/wa/framework/uiauto/app/src/main/java/com/arm/wa/uiauto/BaseUiAutomation.java b/wa/framework/uiauto/app/src/main/java/com/arm/wa/uiauto/BaseUiAutomation.java index 2c657e91..03654486 100644 --- a/wa/framework/uiauto/app/src/main/java/com/arm/wa/uiauto/BaseUiAutomation.java +++ b/wa/framework/uiauto/app/src/main/java/com/arm/wa/uiauto/BaseUiAutomation.java @@ -587,6 +587,27 @@ public class BaseUiAutomation { } } + // If Chrome is a fresh install then these popups may be presented + // dismiss them if visible. + public void dismissChromePopup() throws Exception { + UiObject accept = + mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/terms_accept") + .className("android.widget.Button")); + if (accept.exists()){ + accept.click(); + UiObject negative = + mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/negative_button") + .className("android.widget.Button")); + negative.waitForExists(100000); + negative.click(); + } + UiObject lite = + mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/button_secondary") + .className("android.widget.Button")); + if (lite.exists()){ + lite.click(); + } + } // Override getParams function to decode a url encoded parameter bundle before // passing it to workloads. diff --git a/wa/framework/uiauto/uiauto.aar b/wa/framework/uiauto/uiauto.aar index f0bc0b1a..d52b9732 100644 Binary files a/wa/framework/uiauto/uiauto.aar and b/wa/framework/uiauto/uiauto.aar differ diff --git a/wa/workloads/speedometer/com.arm.wa.uiauto.speedometer.apk b/wa/workloads/speedometer/com.arm.wa.uiauto.speedometer.apk index 202b41e8..89bc21e0 100755 Binary files a/wa/workloads/speedometer/com.arm.wa.uiauto.speedometer.apk and b/wa/workloads/speedometer/com.arm.wa.uiauto.speedometer.apk differ diff --git a/wa/workloads/speedometer/uiauto/app/src/main/java/com/arm/wa/uiauto/speedometer/UiAutomation.java b/wa/workloads/speedometer/uiauto/app/src/main/java/com/arm/wa/uiauto/speedometer/UiAutomation.java index 989d13e8..a4a8a505 100755 --- a/wa/workloads/speedometer/uiauto/app/src/main/java/com/arm/wa/uiauto/speedometer/UiAutomation.java +++ b/wa/workloads/speedometer/uiauto/app/src/main/java/com/arm/wa/uiauto/speedometer/UiAutomation.java @@ -47,7 +47,7 @@ public class UiAutomation extends BaseUiAutomation { @Test public void setup() throws Exception{ setScreenOrientation(ScreenOrientation.NATURAL); - clearFirstRun(); + dismissChromePopup(); } @Test @@ -61,20 +61,6 @@ public class UiAutomation extends BaseUiAutomation { unsetScreenOrientation(); } - public void clearFirstRun() throws Exception { - UiObject accept = - mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/terms_accept") - .className("android.widget.Button")); - if (accept.exists()){ - accept.click(); - UiObject negative = - mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/negative_button") - .className("android.widget.Button")); - negative.waitForExists(100000); - negative.click(); - } - } - public void runBenchmark() throws Exception { UiObject start = mDevice.findObject(new UiSelector().description("Start Test")