Fix "load more messages"
Was simply broken. Bug 3347062 Change-Id: Ic8d16be377ee5a9871f0019a0b008a4de2390f15
This commit is contained in:
parent
e96401a8b2
commit
a796fbab02
@ -239,7 +239,7 @@ public class RefreshManager {
|
|||||||
* "load more messages" in a mailbox.
|
* "load more messages" in a mailbox.
|
||||||
*/
|
*/
|
||||||
public boolean loadMoreMessages(long accountId, long mailboxId) {
|
public boolean loadMoreMessages(long accountId, long mailboxId) {
|
||||||
return refreshMessageList(accountId, mailboxId, true);
|
return refreshMessageList(accountId, mailboxId, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean refreshMessageList(long accountId, long mailboxId, boolean loadMoreMessages,
|
private boolean refreshMessageList(long accountId, long mailboxId, boolean loadMoreMessages,
|
||||||
|
@ -402,6 +402,17 @@ public class RefreshManagerTest extends InstrumentationTestCase {
|
|||||||
}, WAIT_UNTIL_TIMEOUT_SECONDS);
|
}, WAIT_UNTIL_TIMEOUT_SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testLoadMoreMessages() {
|
||||||
|
final long ACCOUNT_ID = 123;
|
||||||
|
final long MAILBOX_ID = 456;
|
||||||
|
|
||||||
|
mTarget.loadMoreMessages(ACCOUNT_ID, MAILBOX_ID);
|
||||||
|
|
||||||
|
assertTrue(mController.mCalledLoadMoreMessages);
|
||||||
|
assertEquals(mController.mMailboxId, MAILBOX_ID);
|
||||||
|
assertFalse(mController.mCalledUpdateMailbox);
|
||||||
|
}
|
||||||
|
|
||||||
// volatile is necessary for testSendPendingMessagesForAllAccounts().
|
// volatile is necessary for testSendPendingMessagesForAllAccounts().
|
||||||
// (Not all of them are actually necessary, but added for consistency.)
|
// (Not all of them are actually necessary, but added for consistency.)
|
||||||
private static class MockController extends Controller {
|
private static class MockController extends Controller {
|
||||||
@ -410,6 +421,7 @@ public class RefreshManagerTest extends InstrumentationTestCase {
|
|||||||
public volatile boolean mCalledSendPendingMessages;
|
public volatile boolean mCalledSendPendingMessages;
|
||||||
public volatile boolean mCalledUpdateMailbox;
|
public volatile boolean mCalledUpdateMailbox;
|
||||||
public volatile boolean mCalledUpdateMailboxList;
|
public volatile boolean mCalledUpdateMailboxList;
|
||||||
|
public volatile boolean mCalledLoadMoreMessages;
|
||||||
public volatile Result mListener;
|
public volatile Result mListener;
|
||||||
|
|
||||||
protected MockController(Context context) {
|
protected MockController(Context context) {
|
||||||
@ -443,6 +455,13 @@ public class RefreshManagerTest extends InstrumentationTestCase {
|
|||||||
mAccountId = accountId;
|
mAccountId = accountId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loadMoreMessages(long mailboxId) {
|
||||||
|
mCalledLoadMoreMessages = true;
|
||||||
|
mAccountId = -1;
|
||||||
|
mMailboxId = mailboxId;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addResultCallback(Result listener) {
|
public void addResultCallback(Result listener) {
|
||||||
Assert.assertTrue(mListener == null);
|
Assert.assertTrue(mListener == null);
|
||||||
|
Loading…
Reference in New Issue
Block a user