| 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..3d862848f2e6220c923fde7eab067ac63a710355 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
|
| @@ -6,25 +6,19 @@ package org.chromium.chrome.browser.invalidation;
|
|
|
| import android.accounts.Account;
|
| import android.app.Activity;
|
| -import android.content.ComponentName;
|
| -import android.content.Context;
|
| import android.content.Intent;
|
| -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,67 +282,13 @@ 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());
|
| }
|
|
|
| - /**
|
| - * Mock context that saves all intents given to {@code startService}.
|
| - */
|
| - private static class IntentSavingContext extends AdvancedMockContext {
|
| - private final List<Intent> mStartedIntents = new ArrayList<Intent>();
|
| -
|
| - IntentSavingContext(Context targetContext) {
|
| - super(targetContext);
|
| - }
|
| -
|
| - @Override
|
| - public ComponentName startService(Intent intent) {
|
| - mStartedIntents.add(intent);
|
| - return new ComponentName(this, getClass());
|
| - }
|
| -
|
| - int getNumStartedIntents() {
|
| - return mStartedIntents.size();
|
| - }
|
| -
|
| - Intent getStartedIntent(int idx) {
|
| - return mStartedIntents.get(idx);
|
| - }
|
| -
|
| - @Override
|
| - public PackageManager getPackageManager() {
|
| - return getBaseContext().getPackageManager();
|
| - }
|
| - }
|
| -
|
| }
|
|
|