Index: sync/android/javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java |
diff --git a/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java b/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java |
index 2c5e84168661e04ac73f2b03549162c7be5d658e..b58bda62127b4a624306846b069bb4a75810a8db 100644 |
--- a/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java |
+++ b/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java |
@@ -9,6 +9,8 @@ import android.content.Context; |
import android.test.InstrumentationTestCase; |
import android.test.suitebuilder.annotation.SmallTest; |
+import com.google.ipc.invalidation.external.client.types.ObjectId; |
+ |
import org.chromium.base.CollectionUtil; |
import org.chromium.base.test.util.AdvancedMockContext; |
import org.chromium.base.test.util.Feature; |
@@ -69,6 +71,7 @@ public class InvalidationPreferencesTest extends InstrumentationTestCase { |
InvalidationPreferences invPreferences = new InvalidationPreferences(mContext); |
assertNull(invPreferences.getSavedSyncedAccount()); |
assertNull(invPreferences.getSavedSyncedTypes()); |
+ assertNull(invPreferences.getSavedObjectIds()); |
assertNull(invPreferences.getInternalNotificationClientState()); |
} |
@@ -85,20 +88,26 @@ public class InvalidationPreferencesTest extends InstrumentationTestCase { |
// We should never write both a real type and the all-types type in practice, but we test |
// with them here to ensure that preferences are not interpreting the written data. |
Set<String> syncTypes = CollectionUtil.newHashSet("BOOKMARK", ModelType.ALL_TYPES_TYPE); |
+ Set<ObjectId> objectIds = CollectionUtil.newHashSet( |
+ ObjectId.newInstance(1, "obj1".getBytes()), |
+ ObjectId.newInstance(2, "obj2".getBytes())); |
Account account = new Account("test@example.com", "bogus"); |
byte[] internalClientState = new byte[]{100,101,102}; |
invPreferences.setSyncTypes(editContext, syncTypes); |
+ invPreferences.setObjectIds(editContext, objectIds); |
invPreferences.setAccount(editContext, account); |
invPreferences.setInternalNotificationClientState(editContext, internalClientState); |
// Nothing should yet have been written. |
assertNull(invPreferences.getSavedSyncedAccount()); |
assertNull(invPreferences.getSavedSyncedTypes()); |
+ assertNull(invPreferences.getSavedObjectIds()); |
// Write the new data and verify that they are correctly read back. |
invPreferences.commit(editContext); |
assertEquals(account, invPreferences.getSavedSyncedAccount()); |
assertEquals(syncTypes, invPreferences.getSavedSyncedTypes()); |
+ assertEquals(objectIds, invPreferences.getSavedObjectIds()); |
assertTrue(Arrays.equals( |
internalClientState, invPreferences.getInternalNotificationClientState())); |
} |