diff --git a/wlauto/common/android/BaseUiAutomation.class b/wlauto/common/android/BaseUiAutomation.class index 1f6f8cdd..dc1e8523 100644 Binary files a/wlauto/common/android/BaseUiAutomation.class and b/wlauto/common/android/BaseUiAutomation.class differ 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 772cea5a..0fd3160b 100644 --- a/wlauto/external/uiauto/src/com/arm/wlauto/uiauto/BaseUiAutomation.java +++ b/wlauto/external/uiauto/src/com/arm/wlauto/uiauto/BaseUiAutomation.java @@ -100,7 +100,7 @@ public class BaseUiAutomation extends UiAutomatorTestCase { } } - public void sleep(int second) { + public void sleepSeconds(int second) { super.sleep(second * 1000); } @@ -154,7 +154,7 @@ public class BaseUiAutomation extends UiAutomatorTestCase { long currentTime = System.currentTimeMillis(); boolean found = false; while ((currentTime - startTime) < timeout) { - sleep(2); // poll every two seconds + sleepSeconds(2); // poll every two seconds while ((line = reader.readLine()) != null) { if (line.contains(searchText)) { diff --git a/wlauto/workloads/adobereader/com.arm.wlauto.uiauto.adobereader.jar b/wlauto/workloads/adobereader/com.arm.wlauto.uiauto.adobereader.jar index f91c97fe..5ee04d90 100644 Binary files a/wlauto/workloads/adobereader/com.arm.wlauto.uiauto.adobereader.jar and b/wlauto/workloads/adobereader/com.arm.wlauto.uiauto.adobereader.jar differ diff --git a/wlauto/workloads/andebench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/andebench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index 0d8fa06c..89e7067f 100644 --- a/wlauto/workloads/andebench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/andebench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -78,7 +78,7 @@ public class UiAutomation extends BaseUiAutomation { threadNumberField.setText(numThreads); getUiDevice().pressBack(); - sleep(shortDelaySeconds); + sleepSeconds(shortDelaySeconds); // If the device does not have a physical keyboard, a virtual one might have // poped up when setting the number of threads. If that happend, then the above // backpress would dismiss the vkb and another one will be necessary to return @@ -86,7 +86,7 @@ public class UiAutomation extends BaseUiAutomation { if(threadNumberField.exists()) { getUiDevice().pressBack(); - sleep(shortDelaySeconds); + sleepSeconds(shortDelaySeconds); } } @@ -95,7 +95,7 @@ public class UiAutomation extends BaseUiAutomation { UiObject startButton = new UiObject(selector.className("android.widget.ImageButton") .packageName("com.eembc.coremark")); startButton.click(); - sleep(shortDelaySeconds); + sleepSeconds(shortDelaySeconds); } public void waitForAndExtractResuts() throws Exception { @@ -110,6 +110,6 @@ public class UiAutomation extends BaseUiAutomation { .packageName("com.eembc.coremark")); resultText.waitForExists(TimeUnit.SECONDS.toMillis(shortDelaySeconds)); Log.v(TAG, resultText.getText()); - sleep(shortDelaySeconds); + sleepSeconds(shortDelaySeconds); } } diff --git a/wlauto/workloads/androbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/androbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index dd621aad..140d58cf 100644 --- a/wlauto/workloads/androbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/androbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -37,7 +37,7 @@ public class UiAutomation extends BaseUiAutomation { Bundle status = new Bundle(); status.putString("product", getUiDevice().getProductName()); UiSelector selector = new UiSelector(); - sleep(3); + sleepSeconds(3); UiObject btn_microbench = new UiObject(selector .textContains("Micro") .className("android.widget.Button")); btn_microbench.click(); @@ -53,13 +53,13 @@ public class UiAutomation extends BaseUiAutomation { waitObject(complete_text); - sleep(2); + sleepSeconds(2); complete_text.click(); } finally{ //complete_text.click(); } - sleep(5); + sleepSeconds(5); takeScreenshot("Androbench"); getAutomationSupport().sendStatus(Activity.RESULT_OK, status); } diff --git a/wlauto/workloads/antutu/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/antutu/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index 4d7a08d1..42216398 100644 --- a/wlauto/workloads/antutu/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/antutu/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -109,7 +109,7 @@ public class UiAutomation extends BaseUiAutomation { UiObject closeButton = new UiObject(selector.text("Cancel")); if (closeButton.waitForExists(TimeUnit.SECONDS.toMillis(initialTimeoutSeconds))) { closeButton.click(); - sleep(1); // diaglog dismissal + sleepSeconds(1); // diaglog dismissal return true; } else { return false; @@ -121,7 +121,7 @@ public class UiAutomation extends BaseUiAutomation { UiObject closeButton = new UiObject(selector.text("Close")); if (closeButton.waitForExists(TimeUnit.SECONDS.toMillis(initialTimeoutSeconds))) { closeButton.click(); - sleep(1); // diaglog dismissal + sleepSeconds(1); // diaglog dismissal return true; } else { return false; @@ -137,7 +137,7 @@ public class UiAutomation extends BaseUiAutomation { // dismiss it as long as keeps popping up. while (closeButton.waitForExists(2)) { closeButton.click(); - sleep(1); // diaglog dismissal + sleepSeconds(1); // diaglog dismissal dismissed = true; } return dismissed; @@ -149,7 +149,7 @@ public class UiAutomation extends BaseUiAutomation { .className("android.widget.Button")); test.waitForExists(initialTimeoutSeconds); test.click(); - sleep(1); // possible tab transtion + sleepSeconds(1); // possible tab transtion } /* In version 5 of antutu, the test has been changed from a button widget to a textview */ @@ -160,7 +160,7 @@ public class UiAutomation extends BaseUiAutomation { .className("android.widget.TextView")); test.waitForExists(initialTimeoutSeconds); test.click(); - sleep(1); // possible tab transtion + sleepSeconds(1); // possible tab transtion } @@ -168,14 +168,14 @@ public class UiAutomation extends BaseUiAutomation { UiSelector selector = new UiSelector(); UiObject test = new UiObject(selector.text("Test")); test.click(); - sleep(1); // possible tab transtion + sleepSeconds(1); // possible tab transtion } public void disableSdCardTests() throws Exception { UiSelector selector = new UiSelector(); UiObject custom = new UiObject(selector.textContains("Custom")); custom.click(); - sleep(1); // tab transition + sleepSeconds(1); // tab transition UiObject sdCardButton = new UiObject(selector.text("SD card IO")); sdCardButton.click(); @@ -203,7 +203,7 @@ public class UiAutomation extends BaseUiAutomation { if (detailsButton.exists() || barChart.exists()) { break; } - sleep(5); + sleepSeconds(5); } if (barChart.exists()) { @@ -218,7 +218,7 @@ public class UiAutomation extends BaseUiAutomation { if (qrText.exists()) { break; } - sleep(5); + sleepSeconds(5); } } @@ -313,7 +313,7 @@ public class UiAutomation extends BaseUiAutomation { UiSelector selector = new UiSelector(); UiObject detailsButton = new UiObject(new UiSelector().className("android.widget.Button") .text("Details")); - sleep(1); + sleepSeconds(1); getUiDevice().pressBack(); } } @@ -343,7 +343,7 @@ public class UiAutomation extends BaseUiAutomation { foundResults = true; break; } - sleep(5); + sleepSeconds(5); } if (!foundResults) { @@ -360,20 +360,20 @@ public class UiAutomation extends BaseUiAutomation { if (detailTextView.exists()) { detailTextView.click(); - sleep(1); // tab transition + sleepSeconds(1); // tab transition UiObject testTextView = new UiObject(selector.text("Test") .className("android.widget.TextView")); if (testTextView.exists()) { testTextView.click(); - sleep(1); // tab transition + sleepSeconds(1); // tab transition } UiObject scoresTextView = new UiObject(selector.text("Scores") .className("android.widget.TextView")); if (scoresTextView.exists()) { scoresTextView.click(); - sleep(1); // tab transition + sleepSeconds(1); // tab transition } } } diff --git a/wlauto/workloads/caffeinemark/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/caffeinemark/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index 3979b675..ef4a9438 100644 --- a/wlauto/workloads/caffeinemark/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/caffeinemark/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -70,7 +70,7 @@ public class UiAutomation extends BaseUiAutomation { UiObject detailsButton = new UiObject(selector.text("Details") .className("android.widget.Button")); detailsButton.click(); - sleep(2); + sleepSeconds(2); UiObject linearObject; UiObject detailedScore; diff --git a/wlauto/workloads/cameracapture/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/cameracapture/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index 9c9a2dea..be60e689 100644 --- a/wlauto/workloads/cameracapture/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/cameracapture/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -69,19 +69,19 @@ public class UiAutomation extends BaseUiAutomation { // switch to camera capture mode UiObject clickModes = new UiObject(new UiSelector().descriptionMatches("Camera, video or panorama selector")); clickModes.click(); - sleep(sleepTime); + sleepSeconds(sleepTime); UiObject changeModeToCapture = new UiObject(new UiSelector().descriptionMatches("Switch to photo")); changeModeToCapture.click(); - sleep(sleepTime); + sleepSeconds(sleepTime); // click to capture photos UiObject clickCaptureButton = new UiObject(new UiSelector().descriptionMatches("Shutter button")); for (int i = 0; i < iterations; i++) { clickCaptureButton.longClick(); - sleep(timeDurationBetweenEachCapture); + sleepSeconds(timeDurationBetweenEachCapture); } getUiDevice().pressBack(); } @@ -92,7 +92,7 @@ public class UiAutomation extends BaseUiAutomation { UiObject tutorialText = new UiObject(new UiSelector().resourceId("com.android.camera2:id/photoVideoSwipeTutorialText")); if (tutorialText.waitForExists(TimeUnit.SECONDS.toMillis(5))) { tutorialText.swipeLeft(5); - sleep(sleepTime); + sleepSeconds(sleepTime); tutorialText.swipeRight(5); } @@ -105,7 +105,7 @@ public class UiAutomation extends BaseUiAutomation { for (int i = 0; i < iterations; i++) { clickCaptureButton.longClick(); - sleep(timeDurationBetweenEachCapture); + sleepSeconds(timeDurationBetweenEachCapture); } } @@ -118,14 +118,14 @@ public class UiAutomation extends BaseUiAutomation { // switch to video mode UiObject changeModeToCapture = new UiObject(new UiSelector().descriptionMatches("Switch to Camera Mode")); changeModeToCapture.click(); - sleep(sleepTime); + sleepSeconds(sleepTime); // click to capture photos UiObject clickCaptureButton = new UiObject(new UiSelector().descriptionMatches("Shutter")); for (int i = 0; i < iterations; i++) { clickCaptureButton.longClick(); - sleep(timeDurationBetweenEachCapture); + sleepSeconds(timeDurationBetweenEachCapture); } } } diff --git a/wlauto/workloads/camerarecord/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/camerarecord/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index 90756c6f..824b2c25 100644 --- a/wlauto/workloads/camerarecord/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/camerarecord/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -69,15 +69,15 @@ public class UiAutomation extends BaseUiAutomation { // switch to camera capture mode UiObject clickModes = new UiObject(new UiSelector().descriptionMatches("Camera, video or panorama selector")); clickModes.click(); - sleep(sleepTime); + sleepSeconds(sleepTime); UiObject changeModeToCapture = new UiObject(new UiSelector().descriptionMatches("Switch to video")); changeModeToCapture.click(); - sleep(sleepTime); + sleepSeconds(sleepTime); UiObject clickRecordingButton = new UiObject(new UiSelector().descriptionMatches("Shutter button")); clickRecordingButton.longClick(); - sleep(recordingTime); + sleepSeconds(recordingTime); // Stop video recording clickRecordingButton.longClick(); @@ -89,7 +89,7 @@ public class UiAutomation extends BaseUiAutomation { UiObject tutorialText = new UiObject(new UiSelector().resourceId("com.android.camera2:id/photoVideoSwipeTutorialText")); if (tutorialText.waitForExists(TimeUnit.SECONDS.toMillis(5))) { tutorialText.swipeLeft(5); - sleep(sleepTime); + sleepSeconds(sleepTime); tutorialText.swipeRight(5); } @@ -110,7 +110,7 @@ public class UiAutomation extends BaseUiAutomation { // click to capture photos UiObject clickCaptureButton = new UiObject(new UiSelector().resourceId(captureButtonId)); clickCaptureButton.longClick(); - sleep(recordingTime); + sleepSeconds(recordingTime); // stop video recording clickCaptureButton.longClick(); @@ -124,11 +124,11 @@ public class UiAutomation extends BaseUiAutomation { // Switch to video mode UiObject changeModeToCapture = new UiObject(new UiSelector().descriptionMatches("Switch to Video Camera")); changeModeToCapture.click(); - sleep(sleepTime); + sleepSeconds(sleepTime); UiObject clickRecordingButton = new UiObject(new UiSelector().descriptionMatches("Shutter")); clickRecordingButton.longClick(); - sleep(recordingTime); + sleepSeconds(recordingTime); // Stop video recording clickRecordingButton.longClick(); diff --git a/wlauto/workloads/cfbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/cfbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index 0e61d92d..db5172fa 100644 --- a/wlauto/workloads/cfbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/cfbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -41,21 +41,21 @@ public class UiAutomation extends BaseUiAutomation { .className("android.widget.TextView")); text_bench.click(); - sleep(2); + sleepSeconds(2); try{ UiObject stop_text = new UiObject(selector.textContains("Benchmarking ...") .className("android.widget.TextView")); waitUntilNoObject(stop_text, 600); - sleep(2); + sleepSeconds(2); }finally{ takeScreenshot("cf-bench"); } UiScrollable res = new UiScrollable(new UiSelector());//.scrollable(true)); res.flingToEnd(10); - sleep(2); + sleepSeconds(2); getAutomationSupport().sendStatus(Activity.RESULT_OK, status); } diff --git a/wlauto/workloads/facebook/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/facebook/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index 3c9dbb2c..d25c2fe2 100644 --- a/wlauto/workloads/facebook/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/facebook/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -58,7 +58,7 @@ public class UiAutomation extends BaseUiAutomation { logInButton.clickAndWaitForNewWindow(timeout); - sleep(timeout); + sleepSeconds(timeout); //Click on message logo UiObject messageLogo = new UiObject(new UiSelector() @@ -78,7 +78,7 @@ public class UiAutomation extends BaseUiAutomation { .className("android.widget.RelativeLayout").index(1))); clickMessage.clickAndWaitForNewWindow(timeout); - sleep(timeout); + sleepSeconds(timeout); UiObject sendMessage = new UiObject(new UiSelector() .className("android.widget.FrameLayout").index(4) @@ -89,7 +89,7 @@ public class UiAutomation extends BaseUiAutomation { .text("Write a message"))); sendMessage.click(); - sleep(timeout); + sleepSeconds(timeout); UiObject editMessage = new UiObject(new UiSelector() .className("android.widget.EditText").text("Write a message")); @@ -101,9 +101,9 @@ public class UiAutomation extends BaseUiAutomation { sendButton.click(); getUiDevice().pressDPadDown(); - sleep(timeout); + sleepSeconds(timeout); getUiDevice().pressBack(); - sleep(timeout); + sleepSeconds(timeout); getUiDevice().pressBack(); //Check for notifications @@ -124,9 +124,9 @@ public class UiAutomation extends BaseUiAutomation { .className("android.widget.LinearLayout").index(1))); clickNotify.clickAndWaitForNewWindow(timeout); - sleep(timeout); + sleepSeconds(timeout); getUiDevice().pressBack(); - sleep(timeout); + sleepSeconds(timeout); getUiDevice().pressBack(); //Search for the facebook account @@ -155,21 +155,21 @@ public class UiAutomation extends BaseUiAutomation { editSearch.clearTextField(); editSearch.setText("amol kamble"); - sleep(timeout); + sleepSeconds(timeout); UiObject clickOnSearchResult = new UiObject(new UiSelector() .className("android.webkit.WebView").index(0)); clickOnSearchResult.clickTopLeft(); - sleep(2 * timeout); + sleepSeconds(2 * timeout); getUiDevice().pressBack(); - sleep(timeout); + sleepSeconds(timeout); getUiDevice().pressBack(); clickBar.click(); - sleep(timeout); + sleepSeconds(timeout); //Click on find friends UiObject clickFriends = new UiObject(new UiSelector() @@ -188,7 +188,7 @@ public class UiAutomation extends BaseUiAutomation { UiObject friends = clickFriends.getChild(new UiSelector() .className("android.widget.RelativeLayout").index(3)); friends.click(); - sleep(timeout); + sleepSeconds(timeout); getUiDevice().pressBack(); //Update the status diff --git a/wlauto/workloads/geekbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/geekbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index 8f1bc0b2..0da07afd 100644 --- a/wlauto/workloads/geekbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/geekbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -146,16 +146,16 @@ public class UiAutomation extends UxPerfUiAutomation { public void scrollThroughResults() throws Exception { UiSelector selector = new UiSelector(); getUiDevice().pressKeyCode(KeyEvent.KEYCODE_PAGE_DOWN); - sleep(1); + sleepSeconds(1); getUiDevice().pressKeyCode(KeyEvent.KEYCODE_PAGE_DOWN); - sleep(1); + sleepSeconds(1); getUiDevice().pressKeyCode(KeyEvent.KEYCODE_PAGE_DOWN); - sleep(1); + sleepSeconds(1); getUiDevice().pressKeyCode(KeyEvent.KEYCODE_PAGE_DOWN); } public void shareResults() throws Exception { - sleep(2); // transition + sleepSeconds(2); // transition UiSelector selector = new UiSelector(); getUiDevice().pressMenu(); UiObject shareButton = new UiObject(selector.text("Share") diff --git a/wlauto/workloads/glbenchmark/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/glbenchmark/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index 2c244d64..a443159e 100644 --- a/wlauto/workloads/glbenchmark/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/glbenchmark/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -151,7 +151,7 @@ public class UiAutomation extends BaseUiAutomation { public void extractResults() throws Exception { Log.v(TAG, "Extracting results."); - sleep(2); // wait for the results screen to fully load. + sleepSeconds(2); // wait for the results screen to fully load. UiSelector selector = new UiSelector(); UiObject fpsText = new UiObject(selector.className("android.widget.TextView") .textContains("fps") diff --git a/wlauto/workloads/googlephotos/com.arm.wlauto.uiauto.googlephotos.jar b/wlauto/workloads/googlephotos/com.arm.wlauto.uiauto.googlephotos.jar index 57bac152..95b211af 100644 Binary files a/wlauto/workloads/googlephotos/com.arm.wlauto.uiauto.googlephotos.jar and b/wlauto/workloads/googlephotos/com.arm.wlauto.uiauto.googlephotos.jar differ diff --git a/wlauto/workloads/googlephotos/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/googlephotos/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index b3c81954..88e0ab65 100755 --- a/wlauto/workloads/googlephotos/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/googlephotos/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -49,7 +49,7 @@ public class UiAutomation extends UxPerfUiAutomation { packageName = parameters.getString("package"); packageID = packageName + ":id/"; - sleep(5); // Pause while splash screen loads + sleepSeconds(5); // Pause while splash screen loads setScreenOrientation(ScreenOrientation.NATURAL); dismissWelcomeView(); closePromotionPopUp(); @@ -104,13 +104,13 @@ public class UiAutomation extends UxPerfUiAutomation { UiObject workingFolder = new UiObject(new UiSelector().text("wa-working")); if (!workingFolder.exists()) { - sleep(1); + sleepSeconds(1); uiDeviceSwipeLeft(10); - sleep(1); + sleepSeconds(1); uiDeviceSwipeLeft(10); - sleep(1); + sleepSeconds(1); uiDeviceSwipeLeft(10); - sleep(1); + sleepSeconds(1); } } diff --git a/wlauto/workloads/googleplaybooks/com.arm.wlauto.uiauto.googleplaybooks.jar b/wlauto/workloads/googleplaybooks/com.arm.wlauto.uiauto.googleplaybooks.jar index 9166516c..866b3538 100644 Binary files a/wlauto/workloads/googleplaybooks/com.arm.wlauto.uiauto.googleplaybooks.jar and b/wlauto/workloads/googleplaybooks/com.arm.wlauto.uiauto.googleplaybooks.jar differ diff --git a/wlauto/workloads/googleplaybooks/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/googleplaybooks/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index 0303cd3e..c66618da 100755 --- a/wlauto/workloads/googleplaybooks/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/googleplaybooks/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -141,9 +141,9 @@ public class UiAutomation extends UxPerfUiAutomation { endButton.click(); // Select a random sample book to add to My library - sleep(1); + sleepSeconds(1); tapDisplayCentre(); - sleep(1); + sleepSeconds(1); // Click done button (uses same resource-id) endButton.click(); @@ -204,7 +204,7 @@ public class UiAutomation extends UxPerfUiAutomation { while (!label.exists()) { if (searchTime > 0) { uiDeviceSwipeDown(100); - sleep(1); + sleepSeconds(1); searchTime--; } else { throw new UiObjectNotFoundException( @@ -503,7 +503,7 @@ public class UiAutomation extends UxPerfUiAutomation { } } - sleep(2); + sleepSeconds(2); tapDisplayCentre(); // exit reader settings dialog waitForPage(); } @@ -539,7 +539,7 @@ public class UiAutomation extends UxPerfUiAutomation { .focusable(true))); // On some devices the object in the view hierarchy is found before it // becomes visible on the screen. Therefore add pause instead. - sleep(3); + sleepSeconds(3); if (!activityReader.waitForExists(viewTimeout)) { throw new UiObjectNotFoundException("Could not find \"activity reader view\"."); @@ -554,7 +554,7 @@ public class UiAutomation extends UxPerfUiAutomation { new UiObject(new UiSelector().resourceId(packageID + "action_bar")); if (!actionBar.exists()) { tapDisplayCentre(); - sleep(1); // Allow previous views to settle + sleepSeconds(1); // Allow previous views to settle } UiObject card = @@ -570,11 +570,11 @@ public class UiAutomation extends UxPerfUiAutomation { int y = (int)(getDisplayCentreHeight() * 0.8); while (card.exists()) { tapDisplay(x, y); - sleep(1); + sleepSeconds(1); } tapDisplay(x, y); - sleep(1); // Allow previous views to settle + sleepSeconds(1); // Allow previous views to settle } if (!actionBar.exists()) { @@ -587,7 +587,7 @@ public class UiAutomation extends UxPerfUiAutomation { new UiObject(new UiSelector().resourceId(packageID + "action_bar")); if (actionBar.exists()) { tapDisplayCentre(); - sleep(1); // Allow previous views to settle + sleepSeconds(1); // Allow previous views to settle } if (actionBar.exists()) { diff --git a/wlauto/workloads/googleslides/com.arm.wlauto.uiauto.googleslides.jar b/wlauto/workloads/googleslides/com.arm.wlauto.uiauto.googleslides.jar index 860507ad..797b0855 100644 Binary files a/wlauto/workloads/googleslides/com.arm.wlauto.uiauto.googleslides.jar and b/wlauto/workloads/googleslides/com.arm.wlauto.uiauto.googleslides.jar differ diff --git a/wlauto/workloads/googleslides/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/googleslides/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index a1fa8c44..6c50ad98 100755 --- a/wlauto/workloads/googleslides/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/googleslides/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -61,13 +61,13 @@ public class UiAutomation extends UxPerfUiAutomation { changeAckTimeout(100); // UI automation begins here skipWelcomeScreen(); - sleep(1); + sleepSeconds(1); dismissWorkOfflineBanner(); - sleep(1); + sleepSeconds(1); enablePowerpointCompat(); - sleep(1); + sleepSeconds(1); testEditNewSlidesDocument(newDocumentName, workingDirectoryName, doTextEntry); - sleep(1); + sleepSeconds(1); // Open document openDocument(pushedDocumentName, workingDirectoryName); waitForProgress(WAIT_TIMEOUT_1SEC*30); @@ -312,19 +312,19 @@ public class UiAutomation extends UxPerfUiAutomation { enterTextInSlide(".*[Tt]itle.*", docName); // Save saveDocument(docName); - sleep(1); + sleepSeconds(1); } // Slide 2 - Image insertSlide("Title only"); insertImage(workingDirectoryName); - sleep(1); + sleepSeconds(1); // If text wasn't entered in first slide, save prompt will appear here if (!doTextEntry) { // Save saveDocument(docName); - sleep(1); + sleepSeconds(1); } // Slide 3 - Shape @@ -333,7 +333,7 @@ public class UiAutomation extends UxPerfUiAutomation { insertShape(shapeName); modifyShape(shapeName); getUiDevice().pressBack(); - sleep(1); + sleepSeconds(1); // Tidy up getUiDevice().pressBack(); @@ -366,7 +366,7 @@ public class UiAutomation extends UxPerfUiAutomation { waitForProgress(WAIT_TIMEOUT_1SEC*5); } logger.stop(); - sleep(1); + sleepSeconds(1); // scroll backward in edit mode logger = new ActionLogger(testTag + "_editbackward", parameters); @@ -376,7 +376,7 @@ public class UiAutomation extends UxPerfUiAutomation { waitForProgress(WAIT_TIMEOUT_1SEC*5); } logger.stop(); - sleep(1); + sleepSeconds(1); // run slideshow logger = new ActionLogger(testTag + "_run", parameters); @@ -392,7 +392,7 @@ public class UiAutomation extends UxPerfUiAutomation { presentation.waitForExists(WAIT_TIMEOUT_1SEC*30); } logger.stop(); - sleep(1); + sleepSeconds(1); slideIndex = 0; @@ -404,7 +404,7 @@ public class UiAutomation extends UxPerfUiAutomation { waitForProgress(WAIT_TIMEOUT_1SEC*5); } logger.stop(); - sleep(1); + sleepSeconds(1); // scroll backward in slideshow mode logger = new ActionLogger(testTag + "_playbackward", parameters); @@ -414,7 +414,7 @@ public class UiAutomation extends UxPerfUiAutomation { waitForProgress(WAIT_TIMEOUT_1SEC*5); } logger.stop(); - sleep(1); + sleepSeconds(1); getUiDevice().pressBack(); getUiDevice().pressBack(); diff --git a/wlauto/workloads/peacekeeper/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/peacekeeper/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index 2384b800..3eb28b6d 100644 --- a/wlauto/workloads/peacekeeper/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/peacekeeper/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -85,7 +85,7 @@ public class UiAutomation extends BaseUiAutomation { writer.println(urlAddress); break; } - sleep(10); + sleepSeconds(10); } } else if (browser.equals("chrome")) { // Code for Chrome browser UiObject adressBar = new UiObject(new UiSelector() @@ -106,7 +106,7 @@ public class UiAutomation extends BaseUiAutomation { writer.println(urlAddress); break; } - sleep(10); + sleepSeconds(10); } } writer.close(); diff --git a/wlauto/workloads/skype/com.arm.wlauto.uiauto.skype.jar b/wlauto/workloads/skype/com.arm.wlauto.uiauto.skype.jar index 84275874..ff3d5f93 100644 Binary files a/wlauto/workloads/skype/com.arm.wlauto.uiauto.skype.jar and b/wlauto/workloads/skype/com.arm.wlauto.uiauto.skype.jar differ diff --git a/wlauto/workloads/skype/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/skype/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index 1dd57b16..85181835 100755 --- a/wlauto/workloads/skype/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/skype/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package com.arm.wlauto.uiauto.skype; import android.os.Bundle; @@ -194,6 +193,6 @@ public class UiAutomation extends UxPerfUiAutomation { new UiObject(new UiSelector().descriptionContains("Mute")); muteButton.click(); - sleep(duration); + sleepSeconds(duration); } } diff --git a/wlauto/workloads/smartbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/smartbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index e8c3aac1..f303a235 100644 --- a/wlauto/workloads/smartbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/smartbench/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -37,7 +37,7 @@ public class UiAutomation extends BaseUiAutomation { Bundle status = new Bundle(); status.putString("product", getUiDevice().getProductName()); UiSelector selector = new UiSelector(); - sleep(3); + sleepSeconds(3); UiObject text_bench = new UiObject(selector.text("Run SmartBench") .className("android.widget.TextView")); text_bench.click(); @@ -48,13 +48,13 @@ public class UiAutomation extends BaseUiAutomation { waitObject(complete_text); - sleep(2); + sleepSeconds(2); complete_text.click(); } finally{ //complete_text.click(); } - sleep(5); + sleepSeconds(5); takeScreenshot("SmartBench"); getAutomationSupport().sendStatus(Activity.RESULT_OK, status); } diff --git a/wlauto/workloads/sqlite/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/sqlite/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index c11725e3..e882c5cd 100644 --- a/wlauto/workloads/sqlite/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/sqlite/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -48,7 +48,7 @@ public class UiAutomation extends BaseUiAutomation { .className("android.widget.Button")); waitUntilNoObject(stop_text, 600); - sleep(2); + sleepSeconds(2); this.extractResults(); } finally { } @@ -94,7 +94,7 @@ public class UiAutomation extends BaseUiAutomation { if (!label.exists()){ resultList.scrollForward(); index--; - sleep(1); + sleepSeconds(1); continue; } Log.v("sqlite", label.getText() + " = " + value.getText().replace("\n", " ")); diff --git a/wlauto/workloads/vellamo/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/vellamo/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index ca29dc9b..8a29e20d 100644 --- a/wlauto/workloads/vellamo/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/vellamo/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -178,9 +178,9 @@ public class UiAutomation extends BaseUiAutomation { throw new UiObjectNotFoundException("Could not find \"Swipe screen\"."); } } - sleep(1); + sleepSeconds(1); swipeScreen.swipeLeft(2); - sleep(1); + sleepSeconds(1); swipeScreen.swipeLeft(2); } diff --git a/wlauto/workloads/videostreaming/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/videostreaming/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index e532b499..9b36af34 100644 --- a/wlauto/workloads/videostreaming/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/videostreaming/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -121,7 +121,7 @@ public class UiAutomation extends BaseUiAutomation { UiObject videoCurrentTime = new UiObject(new UiSelector() .className("android.widget.TextView").index(0)); - sleep(samplingInterval); + sleepSeconds(samplingInterval); // Handle the time taken by the getText function timeBeforeGetText = new Date().getTime() / 1000; @@ -146,7 +146,7 @@ public class UiAutomation extends BaseUiAutomation { } } else { - sleep(videoTime); + sleepSeconds(videoTime); } getUiDevice().pressBack(); getUiDevice().pressHome(); diff --git a/wlauto/workloads/youtube/com.arm.wlauto.uiauto.youtube.jar b/wlauto/workloads/youtube/com.arm.wlauto.uiauto.youtube.jar index 9aad9634..b9086d7c 100644 Binary files a/wlauto/workloads/youtube/com.arm.wlauto.uiauto.youtube.jar and b/wlauto/workloads/youtube/com.arm.wlauto.uiauto.youtube.jar differ diff --git a/wlauto/workloads/youtube/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/youtube/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index 44313008..deedc9bc 100755 --- a/wlauto/workloads/youtube/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/youtube/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -182,7 +182,7 @@ public class UiAutomation extends UxPerfUiAutomation { new UiObject(new UiSelector().textContains("Skip ad")); if (skip.waitForExists(WAIT_TIMEOUT_1SEC*5)) { skip.click(); - sleep(VIDEO_SLEEP_SECONDS); + sleepSeconds(VIDEO_SLEEP_SECONDS); } } } @@ -199,11 +199,11 @@ public class UiAutomation extends UxPerfUiAutomation { public void pausePlayVideo() throws Exception { UiObject player = getUiObjectByResourceId(packageID + "player_fragment_container"); - sleep(VIDEO_SLEEP_SECONDS); + sleepSeconds(VIDEO_SLEEP_SECONDS); repeatClickUiObject(player, 2, 100); - sleep(1); // pause the video momentarily + sleepSeconds(1); // pause the video momentarily player.click(); - sleep(VIDEO_SLEEP_SECONDS); + sleepSeconds(VIDEO_SLEEP_SECONDS); } public void checkVideoInfo() throws Exception { @@ -237,6 +237,6 @@ public class UiAutomation extends UxPerfUiAutomation { } // After flinging, give the window enough time to settle down before // the next step, or else UiAutomator fails to find views in time - sleep(VIDEO_SLEEP_SECONDS); + sleepSeconds(VIDEO_SLEEP_SECONDS); } }