| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.components.invalidation; | 5 package org.chromium.components.invalidation; |
| 6 | 6 |
| 7 import android.accounts.Account; | 7 import android.accounts.Account; |
| 8 import android.content.ComponentName; | 8 import android.content.ComponentName; |
| 9 import android.content.Context; | 9 import android.content.Context; |
| 10 import android.content.Intent; | 10 import android.content.Intent; |
| 11 import android.test.ServiceTestCase; | 11 import android.test.ServiceTestCase; |
| 12 import android.test.suitebuilder.annotation.SmallTest; | 12 import android.test.suitebuilder.annotation.SmallTest; |
| 13 | 13 |
| 14 import com.google.ipc.invalidation.external.client.InvalidationListener.Registra
tionState; | 14 import com.google.ipc.invalidation.external.client.InvalidationListener.Registra
tionState; |
| 15 import com.google.ipc.invalidation.external.client.contrib.AndroidListener; | 15 import com.google.ipc.invalidation.external.client.contrib.AndroidListener; |
| 16 import com.google.ipc.invalidation.external.client.types.ErrorInfo; | 16 import com.google.ipc.invalidation.external.client.types.ErrorInfo; |
| 17 import com.google.ipc.invalidation.external.client.types.Invalidation; | 17 import com.google.ipc.invalidation.external.client.types.Invalidation; |
| 18 import com.google.ipc.invalidation.external.client.types.ObjectId; | 18 import com.google.ipc.invalidation.external.client.types.ObjectId; |
| 19 | 19 |
| 20 import org.chromium.base.CollectionUtil; | 20 import org.chromium.base.CollectionUtil; |
| 21 import org.chromium.base.ContextUtils; | 21 import org.chromium.base.ContextUtils; |
| 22 import org.chromium.base.PathUtils; | 22 import org.chromium.base.PathUtils; |
| 23 import org.chromium.base.library_loader.LibraryLoader; | 23 import org.chromium.base.library_loader.LibraryLoader; |
| 24 import org.chromium.base.library_loader.LibraryProcessType; | 24 import org.chromium.base.library_loader.LibraryProcessType; |
| 25 import org.chromium.base.test.util.AdvancedMockContext; | 25 import org.chromium.base.test.util.AdvancedMockContext; |
| 26 import org.chromium.base.test.util.Feature; | 26 import org.chromium.base.test.util.Feature; |
| 27 import org.chromium.sync.ModelType; | 27 import org.chromium.components.sync.ModelType; |
| 28 import org.chromium.sync.ModelTypeHelper; | 28 import org.chromium.components.sync.ModelTypeHelper; |
| 29 import org.chromium.sync.notifier.InvalidationIntentProtocol; | 29 import org.chromium.components.sync.notifier.InvalidationIntentProtocol; |
| 30 import org.chromium.sync.notifier.InvalidationPreferences; | 30 import org.chromium.components.sync.notifier.InvalidationPreferences; |
| 31 import org.chromium.sync.notifier.InvalidationPreferences.EditContext; | 31 import org.chromium.components.sync.notifier.InvalidationPreferences.EditContext
; |
| 32 import org.chromium.sync.signin.AccountManagerHelper; | 32 import org.chromium.components.sync.signin.AccountManagerHelper; |
| 33 | 33 |
| 34 import java.util.ArrayList; | 34 import java.util.ArrayList; |
| 35 import java.util.Arrays; | 35 import java.util.Arrays; |
| 36 import java.util.HashSet; | 36 import java.util.HashSet; |
| 37 import java.util.List; | 37 import java.util.List; |
| 38 import java.util.Set; | 38 import java.util.Set; |
| 39 | 39 |
| 40 /** | 40 /** |
| 41 * Tests for the {@link InvalidationClientService}. | 41 * Tests for the {@link InvalidationClientService}. |
| 42 * | 42 * |
| (...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 InvalidationClientService.CLIENT_TYPE, "unused".getBytes()); | 893 InvalidationClientService.CLIENT_TYPE, "unused".getBytes()); |
| 894 return intent.getExtras().keySet().equals(startIntent.getExtras().keySet
()); | 894 return intent.getExtras().keySet().equals(startIntent.getExtras().keySet
()); |
| 895 } | 895 } |
| 896 | 896 |
| 897 /** Returns whether {@code intent} is an {@link AndroidListener} stop intent
. */ | 897 /** Returns whether {@code intent} is an {@link AndroidListener} stop intent
. */ |
| 898 private boolean isAndroidListenerStopIntent(Intent intent) { | 898 private boolean isAndroidListenerStopIntent(Intent intent) { |
| 899 Intent stopIntent = AndroidListener.createStopIntent(getContext()); | 899 Intent stopIntent = AndroidListener.createStopIntent(getContext()); |
| 900 return intent.getExtras().keySet().equals(stopIntent.getExtras().keySet(
)); | 900 return intent.getExtras().keySet().equals(stopIntent.getExtras().keySet(
)); |
| 901 } | 901 } |
| 902 } | 902 } |
| OLD | NEW |