1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-02 03:12:34 +01:00

workloads/gmail: Add offline mode

This commit is contained in:
Joe Savage
2018-06-15 10:03:06 +01:00
committed by setrofim
parent 6cc1ac147c
commit 915465c744
3 changed files with 48 additions and 3 deletions

View File

@@ -39,6 +39,7 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
protected String packageID;
protected String recipient;
protected String workdir_name;
protected boolean offlineMode;
private int networkTimeoutSecs = 30;
private long networkTimeout = TimeUnit.SECONDS.toMillis(networkTimeoutSecs);
@@ -49,6 +50,7 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
packageID = getPackageID(parameters);
recipient = parameters.getString("recipient");
workdir_name = parameters.getString("workdir_name");
offlineMode = parameters.getBoolean("offline_mode");
}
@Test
@@ -112,6 +114,11 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
takeMeToBox.clickAndWaitForNewWindow(uiAutoTimeout);
}
// If we're in offline mode we don't need to worry about syncing, so we're done
if (offlineMode) {
return;
}
UiObject syncNowButton =
mDevice.findObject(new UiSelector().textContains("Sync now")
.className("android.widget.Button"));