mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-03 17:59:39 +02:00
Small benchmark improvements (#2264)
This commit is contained in:
parent
f5570baa0b
commit
724dc43970
4 changed files with 10 additions and 6 deletions
|
@ -59,11 +59,13 @@ public class TestUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public static ActivityScenarioRule<ConversationListActivity> getOfflineActivityRule() {
|
public static ActivityScenarioRule<ConversationListActivity> getOfflineActivityRule(boolean useExistingChats) {
|
||||||
Intent intent =
|
Intent intent =
|
||||||
Intent.makeMainActivity(
|
Intent.makeMainActivity(
|
||||||
new ComponentName(getInstrumentation().getTargetContext(), ConversationListActivity.class));
|
new ComponentName(getInstrumentation().getTargetContext(), ConversationListActivity.class));
|
||||||
createOfflineAccount();
|
if (!useExistingChats) {
|
||||||
|
createOfflineAccount();
|
||||||
|
}
|
||||||
prepare();
|
prepare();
|
||||||
return new ActivityScenarioRule<>(intent);
|
return new ActivityScenarioRule<>(intent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class EnterChatsBenchmark {
|
||||||
private final static String TAG = EnterChatsBenchmark.class.getSimpleName();
|
private final static String TAG = EnterChatsBenchmark.class.getSimpleName();
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
public ActivityScenarioRule<ConversationListActivity> activityRule = TestUtils.getOfflineActivityRule();
|
public ActivityScenarioRule<ConversationListActivity> activityRule = TestUtils.getOfflineActivityRule(USE_EXISTING_CHATS);
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void createAndEnter10FilledChats() {
|
public void createAndEnter10FilledChats() {
|
||||||
|
@ -70,7 +70,9 @@ public class EnterChatsBenchmark {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void enterFilledChat() {
|
public void enterFilledChat() {
|
||||||
createChatAndGoBack("Group #1", true, "Hello!", "Some links: https://testrun.org", "And a command: /help");
|
if (!USE_EXISTING_CHATS) {
|
||||||
|
createChatAndGoBack("Group #1", true, "Hello!", "Some links: https://testrun.org", "And a command: /help");
|
||||||
|
}
|
||||||
|
|
||||||
String[] times = new String[50];
|
String[] times = new String[50];
|
||||||
for (int i = 0; i < times.length; i++) {
|
for (int i = 0; i < times.length; i++) {
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class ForwardingTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
public ActivityScenarioRule<ConversationListActivity> activityRule = TestUtils.getOfflineActivityRule();
|
public ActivityScenarioRule<ConversationListActivity> activityRule = TestUtils.getOfflineActivityRule(false);
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void createChats() {
|
public void createChats() {
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class SharingTest {
|
||||||
private static int createdGroupId;
|
private static int createdGroupId;
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
public ActivityScenarioRule<ConversationListActivity> activityRule = TestUtils.getOfflineActivityRule();
|
public ActivityScenarioRule<ConversationListActivity> activityRule = TestUtils.getOfflineActivityRule(false);
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void createGroup() {
|
public void createGroup() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue