From c1e8c95d053464e0821d45347704bd6c27e7e546 Mon Sep 17 00:00:00 2001 From: Andy Stadler Date: Wed, 8 Dec 2010 22:07:12 -0800 Subject: [PATCH] Fix two errors reported by continous test * Add "ForTest" to skip ProGuard stripping * Remove an unused method Change-Id: I2af04f39bfafc3b3abd433f158363e37d9daccdd --- src/com/android/email/RefreshManager.java | 8 ++------ .../com/android/email/RefreshManagerTest.java | 16 ++++++++-------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/com/android/email/RefreshManager.java b/src/com/android/email/RefreshManager.java index 456a802b5..38d8095e7 100644 --- a/src/com/android/email/RefreshManager.java +++ b/src/com/android/email/RefreshManager.java @@ -303,18 +303,14 @@ public class RefreshManager { return mMessageListStatus.get(mailboxId).isRefreshing(); } - public boolean isRefreshingAnyMailboxList() { + public boolean isRefreshingAnyMailboxListForTest() { return mMailboxListStatus.isRefreshingAny(); } - public boolean isRefreshingAnyMessageList() { + public boolean isRefreshingAnyMessageListForTest() { return mMessageListStatus.isRefreshingAny(); } - public boolean isRefreshingAny() { - return isRefreshingAnyMailboxList() || isRefreshingAnyMessageList(); - } - public String getErrorMessage() { return mErrorMessage; } diff --git a/tests/src/com/android/email/RefreshManagerTest.java b/tests/src/com/android/email/RefreshManagerTest.java index 2bad82ccc..3f447fdf1 100644 --- a/tests/src/com/android/email/RefreshManagerTest.java +++ b/tests/src/com/android/email/RefreshManagerTest.java @@ -134,7 +134,7 @@ public class RefreshManagerTest extends InstrumentationTestCase { assertEquals(-1, mController.mMailboxId); mController.reset(); assertTrue(mTarget.isMailboxListRefreshing(ACCOUNT_1)); - assertTrue(mTarget.isRefreshingAnyMailboxList()); + assertTrue(mTarget.isRefreshingAnyMailboxListForTest()); // Request again -- shouldn't be accepted. assertFalse(mTarget.refreshMailboxList(ACCOUNT_1)); @@ -158,7 +158,7 @@ public class RefreshManagerTest extends InstrumentationTestCase { assertEquals(-1, mController.mMailboxId); mController.reset(); assertTrue(mTarget.isMailboxListRefreshing(ACCOUNT_2)); - assertTrue(mTarget.isRefreshingAnyMailboxList()); + assertTrue(mTarget.isRefreshingAnyMailboxListForTest()); // Refreshing for account 1... mController.mListener.updateMailboxListCallback(null, ACCOUNT_1, 0); @@ -185,7 +185,7 @@ public class RefreshManagerTest extends InstrumentationTestCase { .getLastRefreshTime()); // Check "any" method. - assertTrue(mTarget.isRefreshingAnyMailboxList()); // still refreshing account 2 + assertTrue(mTarget.isRefreshingAnyMailboxListForTest()); // still refreshing account 2 // Refreshing for account 2... mClock.advance(); @@ -214,7 +214,7 @@ public class RefreshManagerTest extends InstrumentationTestCase { .getLastRefreshTime()); // Check "any" method. - assertFalse(mTarget.isRefreshingAnyMailboxList()); + assertFalse(mTarget.isRefreshingAnyMailboxListForTest()); } public void testRefreshMessageList() { @@ -231,7 +231,7 @@ public class RefreshManagerTest extends InstrumentationTestCase { assertEquals(MAILBOX_1, mController.mMailboxId); mController.reset(); assertTrue(mTarget.isMessageListRefreshing(MAILBOX_1)); - assertTrue(mTarget.isRefreshingAnyMessageList()); + assertTrue(mTarget.isRefreshingAnyMessageListForTest()); // Request again -- shouldn't be accepted. assertFalse(mTarget.refreshMessageList(ACCOUNT_1, MAILBOX_1)); @@ -255,7 +255,7 @@ public class RefreshManagerTest extends InstrumentationTestCase { assertEquals(MAILBOX_2, mController.mMailboxId); mController.reset(); assertTrue(mTarget.isMessageListRefreshing(MAILBOX_2)); - assertTrue(mTarget.isRefreshingAnyMessageList()); + assertTrue(mTarget.isRefreshingAnyMessageListForTest()); // Refreshing mailbox 1... mController.mListener.updateMailboxCallback(null, ACCOUNT_1, MAILBOX_1, 0, 0); @@ -282,7 +282,7 @@ public class RefreshManagerTest extends InstrumentationTestCase { .getLastRefreshTime()); // Check "any" method. - assertTrue(mTarget.isRefreshingAnyMessageList()); // still refreshing mailbox 2 + assertTrue(mTarget.isRefreshingAnyMessageListForTest()); // still refreshing mailbox 2 // Refreshing mailbox 2... mClock.advance(); @@ -311,7 +311,7 @@ public class RefreshManagerTest extends InstrumentationTestCase { .getLastRefreshTime()); // Check "any" method. - assertFalse(mTarget.isRefreshingAnyMessageList()); + assertFalse(mTarget.isRefreshingAnyMessageListForTest()); } public void testSendPendingMessages() {