diff --git a/wlauto/common/android/BaseUiAutomation$1.class b/wlauto/common/android/BaseUiAutomation$1.class index 817842e8..b93b764f 100644 Binary files a/wlauto/common/android/BaseUiAutomation$1.class and b/wlauto/common/android/BaseUiAutomation$1.class differ diff --git a/wlauto/common/android/BaseUiAutomation$AppLaunch.class b/wlauto/common/android/BaseUiAutomation$AppLaunch.class index 79989d01..ca020dcd 100644 Binary files a/wlauto/common/android/BaseUiAutomation$AppLaunch.class and b/wlauto/common/android/BaseUiAutomation$AppLaunch.class differ diff --git a/wlauto/common/android/BaseUiAutomation.class b/wlauto/common/android/BaseUiAutomation.class index 2f6d2a7d..d84d4922 100644 Binary files a/wlauto/common/android/BaseUiAutomation.class and b/wlauto/common/android/BaseUiAutomation.class differ diff --git a/wlauto/common/android/workload.py b/wlauto/common/android/workload.py index 07dbb495..6c91bdc5 100644 --- a/wlauto/common/android/workload.py +++ b/wlauto/common/android/workload.py @@ -630,9 +630,6 @@ class AndroidUxPerfWorkload(AndroidUiAutoBenchmark): super(AndroidUxPerfWorkload, self).__init__(device, **kwargs) # Turn class attribute into instance attribute self.deployable_assets = list(self.deployable_assets) - # Turn off app launch from wa if markers are enabled for uxperf - if self.markers_enabled: - self.launch_main = False def validate(self): super(AndroidUxPerfWorkload, self).validate() 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 e3a2e8cd..30779424 100644 --- a/wlauto/external/uiauto/src/com/arm/wlauto/uiauto/BaseUiAutomation.java +++ b/wlauto/external/uiauto/src/com/arm/wlauto/uiauto/BaseUiAutomation.java @@ -144,6 +144,9 @@ public class BaseUiAutomation extends UiAutomatorTestCase { //Launches the application. public void launch_main() throws Exception{ Process launch_p; + Process stop_app; + stop_app = Runtime.getRuntime().exec(String.format("am force-stop %s", + packageName)); logger.start(); if(activityName.equals("None")) { launch_p = Runtime.getRuntime().exec(String.format("am start -W %s", @@ -157,16 +160,24 @@ public class BaseUiAutomation extends UiAutomatorTestCase { } launch_validate(launch_p); + stop_app.destroy(); launch_p.destroy(); } //Launches the Skype application public void launch_main(String actionName, String dataURI) throws Exception{ Process launch_p; + Process stop_app; + sleep(2); + stop_app = Runtime.getRuntime().exec(String.format("am force-stop %s", + packageName)); logger.start(); + stop_app.waitFor(); launch_p = Runtime.getRuntime().exec(String.format("am start -W -a %s -d %s", actionName, dataURI)); + launch_p.waitFor(); launch_validate(launch_p); + stop_app.destroy(); launch_p.destroy(); } } diff --git a/wlauto/workloads/adobereader/com.arm.wlauto.uiauto.adobereader.jar b/wlauto/workloads/adobereader/com.arm.wlauto.uiauto.adobereader.jar index ddac3703..9cc92c2e 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/adobereader/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/adobereader/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index 3278474a..abae96ca 100755 --- a/wlauto/workloads/adobereader/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/adobereader/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -62,11 +62,11 @@ public class UiAutomation extends UxPerfUiAutomation { UiObject userBeginObject = new UiObject(new UiSelector().textContains("RECENT") .className("android.widget.TextView")); + setScreenOrientation(ScreenOrientation.NATURAL); + dismissWelcomeView(); if(applaunch_enabled) { applaunch.launch_main();//launch the application } - setScreenOrientation(ScreenOrientation.NATURAL); - dismissWelcomeView(); if(applaunch_enabled) { applaunch.launch_end(userBeginObject,5);//mark the end of launch } diff --git a/wlauto/workloads/googlephotos/com.arm.wlauto.uiauto.googlephotos.jar b/wlauto/workloads/googlephotos/com.arm.wlauto.uiauto.googlephotos.jar index a5d4518b..fc11ed43 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 8763a5a5..d849eacc 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 @@ -23,6 +23,7 @@ import com.android.uiautomator.core.UiObject; import com.android.uiautomator.core.UiObjectNotFoundException; import com.android.uiautomator.core.UiSelector; import com.android.uiautomator.core.UiScrollable; +import com.android.uiautomator.core.UiWatcher; import com.arm.wlauto.uiauto.UxPerfUiAutomation; @@ -59,15 +60,20 @@ public class UiAutomation extends UxPerfUiAutomation { UiObject userBeginObject = new UiObject(new UiSelector().textContains("Photos") .className("android.widget.TextView")); - if(applaunch_enabled) { - applaunch.launch_main();//launch the application - } + //Watcher that takes care of backup popup during warm start + UiWatcher backupPopUpWatcher = createBackupPopUpWatcher(); + registerWatcher("backupPopUpWatcher", backupPopUpWatcher); + runWatchers(); setScreenOrientation(ScreenOrientation.NATURAL); dismissWelcomeView(); closePromotionPopUp(); + if(applaunch_enabled) { + applaunch.launch_main();//launch the application + } + if(applaunch_enabled) { applaunch.launch_end(userBeginObject,5);//mark the end of launch } @@ -453,4 +459,26 @@ public class UiAutomation extends UxPerfUiAutomation { break; } } + // Creates a watcher for when a pop up dialog appears with a signin/close button. + private UiWatcher createBackupPopUpWatcher() throws Exception { + UiWatcher backupPopUpWatcher = new UiWatcher() { + @Override + public boolean checkForCondition() { + UiObject closeButton = + new UiObject(new UiSelector().resourceId(packageID + "promo_close_button")); + + if (closeButton.exists()) { + try { + closeButton.click(); + } catch (UiObjectNotFoundException e) { + e.printStackTrace(); + } + + return closeButton.waitUntilGone(TimeUnit.SECONDS.toMillis(10)); + } + return false; + } + }; + return backupPopUpWatcher; + } } diff --git a/wlauto/workloads/googleplaybooks/com.arm.wlauto.uiauto.googleplaybooks.jar b/wlauto/workloads/googleplaybooks/com.arm.wlauto.uiauto.googleplaybooks.jar index 5ffa6a4e..6adc3782 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 fff76f45..3d5f6917 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 @@ -71,9 +71,6 @@ public class UiAutomation extends UxPerfUiAutomation { //Widget on the screen that marks the application ready for user interaction UiObject userBeginObject = new UiObject(new UiSelector().resourceId(packageID + "menu_search")); - if(applaunch_enabled) { - applaunch.launch_main();//launch the application - } setScreenOrientation(ScreenOrientation.NATURAL); @@ -82,6 +79,9 @@ public class UiAutomation extends UxPerfUiAutomation { dismissSendBooksAsGiftsDialog(); dismissSync(); + if(applaunch_enabled) { + applaunch.launch_main();//launch the application + } if(applaunch_enabled) { applaunch.launch_end(userBeginObject,5);//mark the end of launch } diff --git a/wlauto/workloads/skype/com.arm.wlauto.uiauto.skype.jar b/wlauto/workloads/skype/com.arm.wlauto.uiauto.skype.jar index 5352fa82..0779eb2e 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 6250ca9f..aeb2518a 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 @@ -66,9 +66,6 @@ public class UiAutomation extends UxPerfUiAutomation { //Widget on the screen that marks the application ready for user interaction UiObject userBeginObject = new UiObject(new UiSelector().resourceId(packageID + "menu_search")); - if(applaunch_enabled) { - applaunch.launch_main(actionName,dataURI);//launch the application - } setScreenOrientation(ScreenOrientation.NATURAL); @@ -80,6 +77,9 @@ public class UiAutomation extends UxPerfUiAutomation { // Run tests handleLoginScreen(loginName, loginPass); dismissUpdatePopupIfPresent(); + if(applaunch_enabled) { + applaunch.launch_main(actionName,dataURI);//launch the application + } if(applaunch_enabled) { applaunch.launch_end(userBeginObject,5);//mark the end of launch } @@ -184,6 +184,29 @@ public class UiAutomation extends UxPerfUiAutomation { return infoPopUpWatcher; } + // Creates a watcher for when a pop up dialog appears with a continue button. + private UiWatcher createUpdatePopUpWatcher() throws Exception { + UiWatcher updatePopUpWatcher = new UiWatcher() { + @Override + public boolean checkForCondition() { + UiObject continueButton = + new UiObject(new UiSelector().resourceId(packageID + "button2")); + + if (continueButton.exists()) { + try { + continueButton.click(); + } catch (UiObjectNotFoundException e) { + e.printStackTrace(); + } + + return continueButton.waitUntilGone(TimeUnit.SECONDS.toMillis(10)); + } + return false; + } + }; + return updatePopUpWatcher; + } + private void voiceCallTest(int duration) throws Exception { String testTag = "call_voice"; ActionLogger logger = new ActionLogger(testTag, parameters); diff --git a/wlauto/workloads/youtube/com.arm.wlauto.uiauto.youtube.jar b/wlauto/workloads/youtube/com.arm.wlauto.uiauto.youtube.jar index 4ed3f2ac..99fe660f 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 0b549205..b9ed224b 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 @@ -65,13 +65,13 @@ public class UiAutomation extends UxPerfUiAutomation { UiObject userBeginObject = new UiObject(new UiSelector().textContains("Home") .className("android.widget.TextView")); - if(applaunch_enabled) { - applaunch.launch_main();//launch the application - } setScreenOrientation(ScreenOrientation.NATURAL); clearFirstRunDialogues(); disableAutoplay(); + if(applaunch_enabled) { + applaunch.launch_main();//launch the application + } if(applaunch_enabled) { applaunch.launch_end(userBeginObject,5);//mark the end of launch }