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

Unified Diff: components/gcm_driver/instance_id/instance_id_android.h

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: Re-fix FindBugs 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_android.h
diff --git a/components/gcm_driver/instance_id/instance_id_android.h b/components/gcm_driver/instance_id/instance_id_android.h
index a11529604142cc774d0a96cf0e208ef3e6386a97..c5cce21ef01f0f05d29388a860655ee8a51953be 100644
--- a/components/gcm_driver/instance_id/instance_id_android.h
+++ b/components/gcm_driver/instance_id/instance_id_android.h
@@ -24,6 +24,19 @@ namespace instance_id {
// InstanceID implementation for Android.
class InstanceIDAndroid : public InstanceID {
public:
+ // Tests depending on InstanceID that run without a nested Java message loop
+ // must use this. Operations that would normally be asynchronous will instead
+ // block the UI thread.
+ class ScopedBlockOnAsyncTasksForTesting {
+ public:
+ ScopedBlockOnAsyncTasksForTesting();
+ ~ScopedBlockOnAsyncTasksForTesting();
+
+ private:
+ bool previous_value_;
+ DISALLOW_COPY_AND_ASSIGN(ScopedBlockOnAsyncTasksForTesting);
+ };
+
// Register JNI methods.
static bool RegisterJni(JNIEnv* env);

Powered by Google App Engine
This is Rietveld 408576698