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 bd5398a4d1d54d84bc8cc8013579abd4b34893b1..90d4db9560a6dccfbd5cb0319a2815ff260380a0 100644 |
--- a/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationControllerTest.java |
+++ b/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationControllerTest.java |
@@ -152,20 +152,7 @@ public class InvalidationControllerTest extends InstrumentationTestCase { |
@SmallTest |
@Feature({"Sync"}) |
public void testRegisterForSpecificTypes() { |
- final String controllerFlag = "resolveModelTypes"; |
- final ModelTypeResolver resolver = new ModelTypeResolver() { |
- @Override |
- public Set<ModelType> resolveModelTypes(Set<ModelType> modelTypes) { |
- mContext.setFlag(controllerFlag); |
- return modelTypes; |
- } |
- }; |
- InvalidationController controller = new InvalidationController(mContext) { |
- @Override |
- ModelTypeResolver getModelTypeResolver() { |
- return resolver; |
- } |
- }; |
+ InvalidationController controller = new InvalidationController(mContext); |
Account account = new Account("test@example.com", "bogus"); |
controller.setRegisteredTypes(account, false, |
Sets.newHashSet(ModelType.BOOKMARK, ModelType.SESSION)); |
@@ -186,7 +173,6 @@ public class InvalidationControllerTest extends InstrumentationTestCase { |
Set<String> actualTypes = Sets.newHashSet(); |
actualTypes.addAll(intent.getStringArrayListExtra(IntentProtocol.EXTRA_REGISTERED_TYPES)); |
assertEquals(expectedTypes, actualTypes); |
- assertTrue(mContext.isFlagSet(controllerFlag)); |
} |
@SmallTest |
@@ -223,6 +209,9 @@ public class InvalidationControllerTest extends InstrumentationTestCase { |
Set<String> storedModelTypes = new HashSet<String>(); |
storedModelTypes.add(ModelType.BOOKMARK.name()); |
storedModelTypes.add(ModelType.TYPED_URL.name()); |
+ Set<ModelType> refreshedTypes = new HashSet<ModelType>(); |
+ refreshedTypes.add(ModelType.BOOKMARK); |
+ refreshedTypes.add(ModelType.TYPED_URL); |
invalidationPreferences.setSyncTypes(edit, storedModelTypes); |
Account storedAccount = AccountManagerHelper.createAccountFromName("test@gmail.com"); |
invalidationPreferences.setAccount(edit, storedAccount); |
@@ -244,7 +233,7 @@ public class InvalidationControllerTest extends InstrumentationTestCase { |
}; |
// Execute the test. |
- controller.refreshRegisteredTypes(); |
+ controller.refreshRegisteredTypes(refreshedTypes); |
// Validate the values. |
assertEquals(storedAccount, resultAccount.get()); |
@@ -283,7 +272,7 @@ public class InvalidationControllerTest extends InstrumentationTestCase { |
}; |
// Execute the test. |
- controller.refreshRegisteredTypes(); |
+ controller.refreshRegisteredTypes(new HashSet<ModelType>()); |
// Validate the values. |
assertEquals(storedAccount, resultAccount.get()); |