mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-23 18:02:15 -05:00
Merge branch 'master' into pgp_mime_preparations
This commit is contained in:
commit
ba1fc1305f
@ -1,6 +1,7 @@
|
|||||||
package com.fsck.k9.endtoend;
|
package com.fsck.k9.endtoend;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
import android.support.test.InstrumentationRegistry;
|
import android.support.test.InstrumentationRegistry;
|
||||||
import android.support.test.espresso.assertion.ViewAssertions;
|
import android.support.test.espresso.assertion.ViewAssertions;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
@ -11,6 +12,7 @@ import com.fsck.k9.R;
|
|||||||
import com.fsck.k9.endtoend.framework.ApplicationState;
|
import com.fsck.k9.endtoend.framework.ApplicationState;
|
||||||
import com.fsck.k9.endtoend.framework.StubMailServer;
|
import com.fsck.k9.endtoend.framework.StubMailServer;
|
||||||
import com.fsck.k9.endtoend.pages.WelcomeMessagePage;
|
import com.fsck.k9.endtoend.pages.WelcomeMessagePage;
|
||||||
|
import de.cketti.library.changelog.ChangeLog;
|
||||||
import junit.framework.AssertionFailedError;
|
import junit.framework.AssertionFailedError;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
@ -50,6 +52,8 @@ public abstract class AbstractEndToEndTest<T extends Activity> extends ActivityI
|
|||||||
super.setUp();
|
super.setUp();
|
||||||
injectInstrumentation(InstrumentationRegistry.getInstrumentation());
|
injectInstrumentation(InstrumentationRegistry.getInstrumentation());
|
||||||
|
|
||||||
|
skipChangeLogDialog();
|
||||||
|
|
||||||
getActivity();
|
getActivity();
|
||||||
|
|
||||||
if (bypassWelcome) {
|
if (bypassWelcome) {
|
||||||
@ -63,6 +67,11 @@ public abstract class AbstractEndToEndTest<T extends Activity> extends ActivityI
|
|||||||
super.tearDown();
|
super.tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void skipChangeLogDialog() {
|
||||||
|
Context context = getInstrumentation().getTargetContext();
|
||||||
|
new ChangeLog(context).skipLogDialog();
|
||||||
|
}
|
||||||
|
|
||||||
private void bypassWelcomeScreen() {
|
private void bypassWelcomeScreen() {
|
||||||
try {
|
try {
|
||||||
onView(withId(R.id.welcome_message)).check(ViewAssertions.doesNotExist());
|
onView(withId(R.id.welcome_message)).check(ViewAssertions.doesNotExist());
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
package com.fsck.k9.endtoend.pages;
|
package com.fsck.k9.endtoend.pages;
|
||||||
|
|
||||||
import com.fsck.k9.K9;
|
|
||||||
import com.fsck.k9.R;
|
import com.fsck.k9.R;
|
||||||
import android.support.test.espresso.NoMatchingViewException;
|
|
||||||
import android.support.test.espresso.matcher.ViewMatchers;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import static android.support.test.espresso.Espresso.onView;
|
import static android.support.test.espresso.Espresso.onView;
|
||||||
import static android.support.test.espresso.action.ViewActions.clearText;
|
import static android.support.test.espresso.action.ViewActions.clearText;
|
||||||
@ -35,17 +32,6 @@ public class AccountSetupNamesPage extends AbstractPage {
|
|||||||
public AccountsPage clickDone() {
|
public AccountsPage clickDone() {
|
||||||
onView(withId(R.id.done))
|
onView(withId(R.id.done))
|
||||||
.perform(click());
|
.perform(click());
|
||||||
dismissChangelog();
|
|
||||||
return new AccountsPage();
|
return new AccountsPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dismissChangelog() {
|
|
||||||
try {
|
|
||||||
onView(ViewMatchers.withText("OK")).perform(click());
|
|
||||||
} catch (NoMatchingViewException ex) {
|
|
||||||
Log.w(K9.LOG_TAG, "did not find Changelog OK button - ignored");
|
|
||||||
// Ignored. Not the best way of doing this, but Espresso rightly makes
|
|
||||||
// conditional flow difficult.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2285,12 +2285,12 @@ public class MessageListFragment extends Fragment implements OnItemClickListener
|
|||||||
mSelectedCount += selectedCountDelta;
|
mSelectedCount += selectedCountDelta;
|
||||||
}
|
}
|
||||||
|
|
||||||
computeBatchDirection();
|
|
||||||
updateActionModeTitle();
|
|
||||||
|
|
||||||
// make sure the onPrepareActionMode is called
|
// make sure the onPrepareActionMode is called
|
||||||
mActionMode.invalidate();
|
mActionMode.invalidate();
|
||||||
|
|
||||||
|
computeBatchDirection();
|
||||||
|
updateActionModeTitle();
|
||||||
|
|
||||||
computeSelectAllVisibility();
|
computeSelectAllVisibility();
|
||||||
|
|
||||||
mAdapter.notifyDataSetChanged();
|
mAdapter.notifyDataSetChanged();
|
||||||
|
Loading…
Reference in New Issue
Block a user