Jelajahi Sumber

trigger save state info processing in test

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 4 tahun lalu
induk
melakukan
29ba8c948f

+ 22 - 2
src/androidTest/java/com/owncloud/android/ui/activity/UserInfoActivityIT.java

@@ -1,3 +1,23 @@
+/*
+ * Nextcloud Android client application
+ *
+ * @author Andy Scherzinger
+ * Copyright (C) 2020 Andy Scherzinger
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
 package com.owncloud.android.ui.activity;
 
 import android.content.Intent;
@@ -35,10 +55,10 @@ public class UserInfoActivityIT extends AbstractIT {
                                          null
         );
         intent.putExtra(UserInfoActivity.KEY_USER_DATA, Parcels.wrap(userInfo));
-
         UserInfoActivity sut = activityRule.launchActivity(intent);
 
-        longSleep();
+        shortSleep();
+        shortSleep();
 
         screenshot(sut);
     }

+ 2 - 0
src/main/java/com/owncloud/android/ui/activity/UserInfoActivity.java

@@ -135,6 +135,8 @@ public class UserInfoActivity extends DrawerActivity implements Injectable {
 
         if (savedInstanceState != null && savedInstanceState.containsKey(KEY_USER_DATA)) {
             userInfo = Parcels.unwrap(savedInstanceState.getParcelable(KEY_USER_DATA));
+        } else if (bundle.containsKey(KEY_ACCOUNT)) {
+            userInfo = Parcels.unwrap(bundle.getParcelable(KEY_USER_DATA));
         }
 
         mCurrentAccountAvatarRadiusDimension = getResources().getDimension(R.dimen.nav_drawer_header_avatar_radius);