mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-31 02:01:16 +00:00
pcmark: update uiautomation to fix Android-Q breakage
A new popup appears when running pcmark on android Q that complains about the app being built for an older version of android. Since this popup will be temporary, the fix has to make sure not to break in the future when this popup disappears or when the test is ran on a compatible version of android. To achieve this, we attempt to dismiss the popup and if we timeout we silently carry on with the test assuming no popup will appear. Signed-off-by: Qais Yousef <qais.yousef@arm.com>
This commit is contained in:
parent
9a4a90e0a6
commit
e73b299fbe
Binary file not shown.
@ -37,6 +37,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
private int networkTimeoutSecs = 30;
|
||||
private long networkTimeout = TimeUnit.SECONDS.toMillis(networkTimeoutSecs);
|
||||
public static String TAG = "UXPERF";
|
||||
public static final long WAIT_TIMEOUT_5SEC = TimeUnit.SECONDS.toMillis(5);
|
||||
|
||||
@Before
|
||||
public void initialize(){
|
||||
@ -45,6 +46,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
|
||||
@Test
|
||||
public void setup() throws Exception{
|
||||
dismissPopup();
|
||||
setScreenOrientation(ScreenOrientation.NATURAL);
|
||||
loadBenchmarks();
|
||||
installBenchmark();
|
||||
@ -60,6 +62,18 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
unsetScreenOrientation();
|
||||
}
|
||||
|
||||
// If we run the app in newer Android we'll get a popup complaining about
|
||||
// that, silently accept it and carry on.
|
||||
// This function should act as a NOP if no popup appears.
|
||||
public void dismissPopup() throws Exception {
|
||||
UiObject acceptButton =
|
||||
mDevice.findObject(new UiSelector().resourceId("android:id/button1")
|
||||
.className("android.widget.Button"));
|
||||
if (acceptButton.waitForExists(WAIT_TIMEOUT_5SEC)) {
|
||||
acceptButton.click();
|
||||
}
|
||||
}
|
||||
|
||||
//Swipe to benchmarks and back to initialise the app correctly
|
||||
private void loadBenchmarks() throws Exception {
|
||||
UiObject title =
|
||||
|
Loading…
x
Reference in New Issue
Block a user