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

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

Issue 22978010: [Android] Remove all usage of com.google.common.collect (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: collectionutil Created 7 years, 4 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/InvalidationPreferencesTest.java
diff --git a/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java b/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java
index 4586513ca63beb2718ed3d05c79a26b60c946517..9058e45e4f3a75d8ec90947f4e30cf2e9edaa9cc 100644
--- a/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java
+++ b/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java
@@ -9,14 +9,12 @@ import android.content.Context;
import android.test.InstrumentationTestCase;
import android.test.suitebuilder.annotation.SmallTest;
-import com.google.common.collect.Sets;
-
import org.chromium.base.test.util.AdvancedMockContext;
import org.chromium.base.test.util.Feature;
import org.chromium.sync.internal_api.pub.base.ModelType;
-import org.chromium.sync.notifier.InvalidationPreferences;
import java.util.Arrays;
+import java.util.EnumSet;
import java.util.HashSet;
import java.util.Set;
@@ -41,9 +39,10 @@ public class InvalidationPreferencesTest extends InstrumentationTestCase {
* Test plan: convert three strings to model types, one of which is invalid. Verify that
* the two valid strings are properly converted and that the invalid string is dropped.
*/
- HashSet<ModelType> expectedTypes = Sets.newHashSet(ModelType.BOOKMARK, ModelType.SESSION);
+ HashSet<ModelType> expectedTypes = new HashSet<ModelType>(
nyquist 2013/08/20 19:01:57 CollectionUtil.newHashSet here and three places be
Yaron 2013/08/20 23:41:31 Done.
+ Arrays.asList(ModelType.BOOKMARK,ModelType.SESSION));
Set<ModelType> actualTypes = ModelType.syncTypesToModelTypes(
- Sets.newHashSet("BOOKMARK", "SESSION", "0!!!INVALID"));
+ new HashSet<String>(Arrays.asList("BOOKMARK", "SESSION", "0!!!INVALID")));
assertEquals(expectedTypes, actualTypes);
}
@@ -54,9 +53,9 @@ public class InvalidationPreferencesTest extends InstrumentationTestCase {
* Test plan: convert the special all-types type to model types. Verify that it is
* properly expanded.
*/
- HashSet<ModelType> expectedTypes = Sets.newHashSet(ModelType.values());
+ Set<ModelType> expectedTypes = EnumSet.allOf(ModelType.class);
Set<ModelType> actualTypes = ModelType.syncTypesToModelTypes(
- Sets.newHashSet(ModelType.ALL_TYPES_TYPE));
+ new HashSet<String>(Arrays.asList(ModelType.ALL_TYPES_TYPE)));
assertEquals(expectedTypes, actualTypes);
}
@@ -84,7 +83,8 @@ public class InvalidationPreferencesTest extends InstrumentationTestCase {
// We should never write both a real type and the all-types type in practice, but we test
// with them here to ensure that preferences are not interpreting the written data.
- Set<String> syncTypes = Sets.newHashSet("BOOKMARK", ModelType.ALL_TYPES_TYPE);
+ Set<String> syncTypes = new HashSet<String>(
+ Arrays.asList("BOOKMARK", ModelType.ALL_TYPES_TYPE));
Account account = new Account("test@example.com", "bogus");
byte[] internalClientState = new byte[]{100,101,102};
invPreferences.setSyncTypes(editContext, syncTypes);

Powered by Google App Engine
This is Rietveld 408576698