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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java

Issue 457883002: Use Sync FakeServer in Android tests via custom APK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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: chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java
index b28a4879fc845028a826f7e56783b061b0669bdb..80b63549e85a9473375a5010bbacb7b439caa072 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java
@@ -501,6 +501,18 @@ public class ProfileSyncService {
return nativeGetLastSyncedTimeForTest(mNativeProfileSyncServiceAndroid);
}
+ /**
+ * Overrides the Sync engine's NetworkResources. This is used to set up the Sync FakeServer for
+ * testing.
+ *
+ * @param networkResources the pointer to the NetworkResources created by the native code. It
+ * is assumed that the Java caller has ownership of this pointer;
+ * ownership is transferred as part of this call.
+ */
+ public void overrideNetworkResourcesForTest(long networkResources) {
+ nativeOverrideNetworkResourcesForTest(mNativeProfileSyncServiceAndroid, networkResources);
+ }
+
// Native methods
private native void nativeNudgeSyncer(
long nativeProfileSyncServiceAndroid, int objectSource, String objectId, long version,
@@ -552,4 +564,6 @@ public class ProfileSyncService {
private native boolean nativeHasUnrecoverableError(long nativeProfileSyncServiceAndroid);
private native String nativeGetAboutInfoForTest(long nativeProfileSyncServiceAndroid);
private native long nativeGetLastSyncedTimeForTest(long nativeProfileSyncServiceAndroid);
+ private native void nativeOverrideNetworkResourcesForTest(
+ long nativeProfileSyncServiceAndroid, long networkResources);
}

Powered by Google App Engine
This is Rietveld 408576698