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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java

Issue 459513002: Massive refactor of the Android invalidation code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 3 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: chrome/android/javatests/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java
index ed9ea0cb034beb6f83d350ca2f5caa3c04302f0f..81a195911337700b5d214e1f1149150069e760f5 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java
@@ -13,18 +13,16 @@ import android.content.pm.PackageManager;
import android.test.InstrumentationTestCase;
import android.test.suitebuilder.annotation.SmallTest;
-import com.google.ipc.invalidation.external.client.types.ObjectId;
-
import org.chromium.base.ActivityState;
import org.chromium.base.ApplicationState;
import org.chromium.base.ApplicationStatus;
import org.chromium.base.CollectionUtil;
import org.chromium.base.test.util.AdvancedMockContext;
import org.chromium.base.test.util.Feature;
+import org.chromium.components.invalidation.InvalidationClientService;
import org.chromium.sync.internal_api.pub.base.ModelType;
import org.chromium.sync.notifier.InvalidationIntentProtocol;
import org.chromium.sync.notifier.InvalidationPreferences;
-import org.chromium.sync.notifier.InvalidationService;
import org.chromium.sync.notifier.SyncStatusHelper;
import org.chromium.sync.signin.AccountManagerHelper;
import org.chromium.sync.signin.ChromeSigninController;
@@ -288,36 +286,12 @@ public class InvalidationControllerTest extends InstrumentationTestCase {
assertEquals(true, resultAllTypes.get());
}
- @SmallTest
- @Feature({"Sync"})
- public void testSetRegisteredObjectIds() {
- InvalidationController controller = new InvalidationController(mContext);
- ObjectId bookmark = ModelType.BOOKMARK.toObjectId();
- controller.setRegisteredObjectIds(new int[] {1, 2, bookmark.getSource()},
- new String[] {"a", "b", new String(bookmark.getName())});
- assertEquals(1, mContext.getNumStartedIntents());
-
- // Validate destination.
- Intent intent = mContext.getStartedIntent(0);
- validateIntentComponent(intent);
- assertEquals(InvalidationIntentProtocol.ACTION_REGISTER, intent.getAction());
-
- // Validate registered object ids. The bookmark object should not be registered since it is
- // a Sync type.
- assertNull(intent.getStringArrayListExtra(
- InvalidationIntentProtocol.EXTRA_REGISTERED_TYPES));
- Set<ObjectId> objectIds = InvalidationIntentProtocol.getRegisteredObjectIds(intent);
- assertEquals(2, objectIds.size());
- assertTrue(objectIds.contains(ObjectId.newInstance(1, "a".getBytes())));
- assertTrue(objectIds.contains(ObjectId.newInstance(2, "b".getBytes())));
- }
-
/**
* Asserts that {@code intent} is destined for the correct component.
*/
private static void validateIntentComponent(Intent intent) {
assertNotNull(intent.getComponent());
- assertEquals(InvalidationService.class.getName(),
+ assertEquals(InvalidationClientService.class.getName(),
intent.getComponent().getClassName());
}

Powered by Google App Engine
This is Rietveld 408576698