Create ChromeSyncShell and ChromeSyncShellTest
This CL enables usage of the Sync FakeServer in Android tests. This is
done by creating a new ChromeShell-based APK, ChromeSyncShell, and a
test APK that instruments it (ChromeSyncShellTest).
As part of this CL, previously-disabled tests (SyncTest.java) are
re-enabled. However, these tests will not run as part of the Chromium
waterfall/trybots as they are not configured to run ChromeSyncShellTest.
How to run the tests:
1) Build these targets:
chrome_sync_shell_apk
chrome_sync_shell_test_apk
2) Run test script
build/android/adb_install_apk.py \
--apk=ChromeSyncShell.apk && \
build/android/test_runner.py instrumentation \
--test-apk ChromeSyncShellTest
BUG=323265,348951,348117
[email protected]
Review URL: https://codereview.chromium.org/457883002
Cr-Commit-Position: refs/heads/master@{#291190}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291190 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/sync/profile_sync_service_android.cc b/chrome/browser/sync/profile_sync_service_android.cc
index 02e3556..3f5b517 100644
--- a/chrome/browser/sync/profile_sync_service_android.cc
+++ b/chrome/browser/sync/profile_sync_service_android.cc
@@ -34,6 +34,7 @@
#include "google_apis/gaia/google_service_auth_error.h"
#include "grit/generated_resources.h"
#include "jni/ProfileSyncService_jni.h"
+#include "sync/internal_api/public/network_resources.h"
#include "sync/internal_api/public/read_transaction.h"
#include "ui/base/l10n/l10n_util.h"
@@ -475,6 +476,16 @@
profile_->GetPrefs()->GetInt64(sync_driver::prefs::kSyncLastSyncedTime));
}
+void ProfileSyncServiceAndroid::OverrideNetworkResourcesForTest(
+ JNIEnv* env,
+ jobject obj,
+ jlong network_resources) {
+ syncer::NetworkResources* resources =
+ reinterpret_cast<syncer::NetworkResources*>(network_resources);
+ sync_service_->OverrideNetworkResourcesForTest(
+ make_scoped_ptr<syncer::NetworkResources>(resources));
+}
+
void ProfileSyncServiceAndroid::NudgeSyncer(JNIEnv* env,
jobject obj,
jint objectSource,