summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorvadimt <vadimt@google.com>2019-07-25 12:01:45 -0700
committerVadim Tryshev <vadimt@google.com>2019-07-26 20:31:35 +0000
commit003c94f10fc04cfb447d71abe51f4ca088a2d156 (patch)
tree90154207bf68340ed6b449e3ca50ea6bf0f6a019 /tests
parenta7d12b227f2b66dee15ae51d74676e5529e860e7 (diff)
downloadandroid_packages_apps_Trebuchet-003c94f10fc04cfb447d71abe51f4ca088a2d156.tar.gz
android_packages_apps_Trebuchet-003c94f10fc04cfb447d71abe51f4ca088a2d156.tar.bz2
android_packages_apps_Trebuchet-003c94f10fc04cfb447d71abe51f4ca088a2d156.zip
Moving enabling rotation for test
We needed to press home to wait until the launcher starts, now we simply enable rotation once the Launcher gets created. Change-Id: Ie99e5073c06f8da181262d32823116061c81d6f7
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/launcher3/util/rule/LauncherActivityRule.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/tests/src/com/android/launcher3/util/rule/LauncherActivityRule.java b/tests/src/com/android/launcher3/util/rule/LauncherActivityRule.java
index 204240324..62fe26d13 100644
--- a/tests/src/com/android/launcher3/util/rule/LauncherActivityRule.java
+++ b/tests/src/com/android/launcher3/util/rule/LauncherActivityRule.java
@@ -19,6 +19,7 @@ import android.app.Activity;
import android.app.Application;
import android.app.Application.ActivityLifecycleCallbacks;
import android.os.Bundle;
+
import androidx.test.InstrumentationRegistry;
import com.android.launcher3.Launcher;
@@ -84,19 +85,27 @@ public class LauncherActivityRule implements TestRule {
}
@Override
- public void onActivityStarted(Activity activity) { }
+ public void onActivityStarted(Activity activity) {
+ if (activity instanceof Launcher) {
+ mActivity.getRotationHelper().forceAllowRotationForTesting(true);
+ }
+ }
@Override
- public void onActivityResumed(Activity activity) { }
+ public void onActivityResumed(Activity activity) {
+ }
@Override
- public void onActivityPaused(Activity activity) { }
+ public void onActivityPaused(Activity activity) {
+ }
@Override
- public void onActivityStopped(Activity activity) { }
+ public void onActivityStopped(Activity activity) {
+ }
@Override
- public void onActivitySaveInstanceState(Activity activity, Bundle bundle) { }
+ public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
+ }
@Override
public void onActivityDestroyed(Activity activity) {