summaryrefslogtreecommitdiffstats
path: root/sync/android/javatests/src
diff options
context:
space:
mode:
authordsmyers@chromium.org <dsmyers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-29 23:08:36 +0000
committerdsmyers@chromium.org <dsmyers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-29 23:08:36 +0000
commit42b5f9fed5a71037985843d4b15dde5d2322c56c (patch)
tree14f385c2ebf91ea5dee5f2239f00707fa3537991 /sync/android/javatests/src
parente42e1f590dc6db52bd67704d339a2221da89b238 (diff)
downloadchromium_src-42b5f9fed5a71037985843d4b15dde5d2322c56c.zip
chromium_src-42b5f9fed5a71037985843d4b15dde5d2322c56c.tar.gz
chromium_src-42b5f9fed5a71037985843d4b15dde5d2322c56c.tar.bz2
Record client id in ready(), not reissueRegs().
BUG=172390 Review URL: https://chromiumcodereview.appspot.com/12096011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179454 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/android/javatests/src')
-rw-r--r--sync/android/javatests/src/org/chromium/sync/notifier/InvalidationServiceTest.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationServiceTest.java b/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationServiceTest.java
index cfb8c0c..a66f238 100644
--- a/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationServiceTest.java
+++ b/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationServiceTest.java
@@ -127,6 +127,33 @@ public class InvalidationServiceTest extends ServiceTestCase<TestableInvalidatio
@SmallTest
@Feature({"Sync"})
+ public void testReady() {
+ /**
+ * Test plan: call ready. Verify that the service sets the client id correctly and reissues
+ * pending registrations.
+ */
+
+ // Persist some registrations.
+ InvalidationPreferences invPrefs = new InvalidationPreferences(getContext());
+ EditContext editContext = invPrefs.edit();
+ invPrefs.setSyncTypes(editContext, Lists.newArrayList("BOOKMARK", "SESSION"));
+ assertTrue(invPrefs.commit(editContext));
+
+ // Issue ready.
+ getService().ready(CLIENT_ID);
+ assertTrue(Arrays.equals(CLIENT_ID, InvalidationService.getClientIdForTest()));
+ byte[] otherCid = "otherCid".getBytes();
+ getService().ready(otherCid);
+ assertTrue(Arrays.equals(otherCid, InvalidationService.getClientIdForTest()));
+
+ // Verify registrations issued.
+ assertEquals(
+ Sets.newHashSet(ModelType.BOOKMARK.toObjectId(), ModelType.SESSION.toObjectId()),
+ Sets.newHashSet(getService().mRegistrations.get(0)));
+ }
+
+ @SmallTest
+ @Feature({"Sync"})
public void testReissueRegistrations() {
/*
* Test plan: call the reissueRegistrations method of the listener with both empty and