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

Unified Diff: sync/android/javatests/src/org/chromium/sync/notifier/ModelTypeResolverTest.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
« no previous file with comments | « sync/android/javatests/src/org/chromium/sync/notifier/InvalidationControllerTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/android/javatests/src/org/chromium/sync/notifier/ModelTypeResolverTest.java
diff --git a/sync/android/javatests/src/org/chromium/sync/notifier/ModelTypeResolverTest.java b/sync/android/javatests/src/org/chromium/sync/notifier/ModelTypeResolverTest.java
deleted file mode 100644
index aa53eb84af3a846e074a09c3db8223447cd4dbb9..0000000000000000000000000000000000000000
--- a/sync/android/javatests/src/org/chromium/sync/notifier/ModelTypeResolverTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.sync.notifier;
-
-import android.test.InstrumentationTestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-
-import org.chromium.base.test.util.Feature;
-import org.chromium.sync.internal_api.pub.base.ModelType;
-
-import java.util.HashSet;
-import java.util.Set;
-
-public class ModelTypeResolverTest extends InstrumentationTestCase {
- @SmallTest
- @Feature({"Sync"})
- public void testControlTypesShouldAlwaysBeAddedEvenForNullModelTypes() throws Exception {
- ModelTypeResolverImpl resolver = new ModelTypeResolverImpl();
- Set<ModelType> result = resolver.resolveModelTypes(null);
- assertNotNull(result);
- assertEquals("Size should be the same as number of control types",
- ModelType.controlTypes().size(), result.size());
- assertTrue("Should contain all control ModelTypes",
- result.containsAll(ModelType.controlTypes()));
- }
-
- @SmallTest
- @Feature({"Sync"})
- public void testControlTypesShouldAlwaysBeAdded() throws Exception {
- ModelTypeResolverImpl resolver = new ModelTypeResolverImpl();
- Set<ModelType> result = resolver.resolveModelTypes(new HashSet<ModelType>());
- assertNotNull(result);
- assertEquals("Size should be the same as number of control types",
- ModelType.controlTypes().size(), result.size());
- assertTrue("Should contain all control ModelTypes",
- result.containsAll(ModelType.controlTypes()));
- }
-
- @SmallTest
- @Feature({"Sync"})
- public void testAddingAutofillShouldAddAutofillProfile() throws Exception {
- Set<ModelType> modelTypes = new HashSet<ModelType>();
- modelTypes.add(ModelType.AUTOFILL);
- ModelTypeResolverImpl resolver = new ModelTypeResolverImpl();
- Set<ModelType> result = resolver.resolveModelTypes(modelTypes);
- assertNotNull(result);
- assertEquals("Size should be 2 plus the number of control types",
- 2 + ModelType.controlTypes().size(), result.size());
- assertTrue("Should have AUTOFILL ModelType", result.contains(ModelType.AUTOFILL));
- assertTrue("Should have AUTOFILL_PROFILE ModelType",
- result.contains(ModelType.AUTOFILL_PROFILE));
- }
-
- @SmallTest
- @Feature({"Sync"})
- public void testModelTypesThatArePartOfGroupsShouldStillWork() throws Exception {
- Set<ModelType> modelTypes = new HashSet<ModelType>();
- modelTypes.add(ModelType.BOOKMARK);
- modelTypes.add(ModelType.SESSION);
- modelTypes.add(ModelType.TYPED_URL);
- ModelTypeResolverImpl resolver = new ModelTypeResolverImpl();
- Set<ModelType> result = resolver.resolveModelTypes(modelTypes);
- assertNotNull(result);
- assertEquals("Size should be " + modelTypes.size() + " plus the number of control types",
- modelTypes.size() + ModelType.controlTypes().size(), result.size());
- assertTrue("Should have BOOKMARK ModelType", result.contains(ModelType.BOOKMARK));
- assertTrue("Should have SESSION ModelType", result.contains(ModelType.SESSION));
- assertTrue("Should have TYPED_URL ModelType", result.contains(ModelType.TYPED_URL));
- }
-}
« no previous file with comments | « sync/android/javatests/src/org/chromium/sync/notifier/InvalidationControllerTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698