Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: sync/android/javatests/src/org/chromium/sync/notifier/InvalidationControllerTest.java

Issue 13109002: [Sync] Move Android enabled types logic into native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());

Powered by Google App Engine
This is Rietveld 408576698