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

Unified Diff: chrome/android/sync_shell/javatests/src/chromium/chrome/browser/sync/FakeServerHelper.java

Issue 884073005: Create a Android Sync integration test for typed URLs (try #2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/sync_shell/javatests/src/chromium/chrome/browser/sync/FakeServerHelper.java
diff --git a/chrome/android/sync_shell/javatests/src/chromium/chrome/browser/sync/FakeServerHelper.java b/chrome/android/sync_shell/javatests/src/chromium/chrome/browser/sync/FakeServerHelper.java
index 09a25ce673c06ba2aed6e30c9c8b9fcad538a497..51cd031c4bbe04b9e5f77f066443da198361811c 100644
--- a/chrome/android/sync_shell/javatests/src/chromium/chrome/browser/sync/FakeServerHelper.java
+++ b/chrome/android/sync_shell/javatests/src/chromium/chrome/browser/sync/FakeServerHelper.java
@@ -7,7 +7,7 @@ package org.chromium.chrome.browser.sync;
import android.content.Context;
import org.chromium.base.ThreadUtils;
-//import org.chromium.chrome.browser.sync.ProfileSyncService;
+import org.chromium.sync.internal_api.pub.base.ModelType;
import java.util.concurrent.Callable;
@@ -113,6 +113,25 @@ public class FakeServerHelper {
nativeDeleteFakeServer(mNativeFakeServerHelperAndroid, nativeFakeServer);
}
+ /**
+ * Returns whether {@code count} entities exist on the fake Sync server with the given
+ * {@code modelType} and {@code name}.
+ *
+ * @param count the number of fake server entities to verify
+ * @param modelType the model type of entities to verify
+ * @param name the name of entities to verify
+ *
+ * @return whether the number of specified entities exist
+ */
+ public boolean verifyEntityCountByTypeAndName(int count, ModelType modelType, String name) {
+ if (sNativeFakeServer == 0L) {
+ throw new IllegalStateException(
+ "useFakeServer must be called before data verification.");
+ }
+ return nativeVerifyEntityCountByTypeAndName(mNativeFakeServerHelperAndroid,
+ sNativeFakeServer, count, modelType.toString(), name);
+ }
+
// Native methods.
private native long nativeInit();
private native long nativeCreateFakeServer(long nativeFakeServerHelperAndroid);
@@ -120,4 +139,7 @@ public class FakeServerHelper {
long nativeFakeServerHelperAndroid, long nativeFakeServer);
private native void nativeDeleteFakeServer(
long nativeFakeServerHelperAndroid, long nativeFakeServer);
+ private native boolean nativeVerifyEntityCountByTypeAndName(
+ long nativeFakeServerHelperAndroid, long nativeFakeServer, int count, String modelType,
+ String name);
}
« no previous file with comments | « chrome/android/BUILD.gn ('k') | chrome/android/sync_shell/javatests/src/chromium/chrome/browser/sync/SyncTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698