| Index: sync/android/javatests/src/org/chromium/sync/notifier/InvalidationControllerTest.java
|
| diff --git a/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationControllerTest.java b/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationControllerTest.java
|
| index 44f9eb40e5451085ac89760c8ac23b7ba01fe790..bd1ead655daf80af2de6bbfbf6a6b20e093451b7 100644
|
| --- a/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationControllerTest.java
|
| +++ b/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationControllerTest.java
|
| @@ -177,6 +177,32 @@ public class InvalidationControllerTest extends InstrumentationTestCase {
|
|
|
| @SmallTest
|
| @Feature({"Sync"})
|
| + public void testRegisterForSpecificTypesNoProxyTabs() {
|
| + InvalidationController controller = new InvalidationController(mContext);
|
| + Account account = new Account("test@example.com", "bogus");
|
| + controller.setRegisteredTypes(account, false,
|
| + Sets.newHashSet(ModelType.BOOKMARK, ModelType.SESSION, ModelType.PROXY_TABS));
|
| + assertEquals(1, mContext.getNumStartedIntents());
|
| +
|
| + // Validate destination.
|
| + Intent intent = mContext.getStartedIntent(0);
|
| + validateIntentComponent(intent);
|
| + assertEquals(IntentProtocol.ACTION_REGISTER, intent.getAction());
|
| +
|
| + // Validate account.
|
| + Account intentAccount = intent.getParcelableExtra(IntentProtocol.EXTRA_ACCOUNT);
|
| + assertEquals(account, intentAccount);
|
| +
|
| + // Validate registered types. Should not include PROXY_TABS.
|
| + Set<String> expectedTypes =
|
| + Sets.newHashSet(ModelType.BOOKMARK.name(), ModelType.SESSION.name());
|
| + Set<String> actualTypes = Sets.newHashSet();
|
| + actualTypes.addAll(intent.getStringArrayListExtra(IntentProtocol.EXTRA_REGISTERED_TYPES));
|
| + assertEquals(expectedTypes, actualTypes);
|
| + }
|
| +
|
| + @SmallTest
|
| + @Feature({"Sync"})
|
| public void testRegisterForAllTypes() {
|
| Account account = new Account("test@example.com", "bogus");
|
| mController.setRegisteredTypes(account, true,
|
|
|