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

Unified Diff: components/gcm_driver/instance_id/instance_id_test_utils_android.cc

Issue 1829023002: Add fake for InstanceIDWithSubtype.java, in order to re-use unit test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@iid2jni
Patch Set: Address 2nd round review comments Created 4 years, 8 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: components/gcm_driver/instance_id/instance_id_test_utils_android.cc
diff --git a/components/gcm_driver/instance_id/instance_id_test_utils_android.cc b/components/gcm_driver/instance_id/instance_id_test_utils_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..148c56f710e963c24d8a531b57041a7563a05e56
--- /dev/null
+++ b/components/gcm_driver/instance_id/instance_id_test_utils_android.cc
@@ -0,0 +1,26 @@
+// Copyright 2016 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.
+
+#include "components/gcm_driver/instance_id/instance_id_test_utils_android.h"
+
+#include "base/android/jni_android.h"
+#include "jni/FakeInstanceIDWithSubtype_jni.h"
+
+using base::android::AttachCurrentThread;
+
+namespace instance_id {
+
+// static
+bool InstanceIDTestUtilsAndroid::RegisterJni(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
+// static
+void InstanceIDTestUtilsAndroid::ClearDataAndSetUseFakeForTesting(
+ bool use_fake) {
+ JNIEnv* env = AttachCurrentThread();
+ Java_FakeInstanceIDWithSubtype_clearDataAndSetEnabled(env, use_fake);
+}
+
+} // namespace instance_id

Powered by Google App Engine
This is Rietveld 408576698