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); |