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

Unified Diff: components/gcm_driver/instance_id/instance_id_driver_unittest.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: Move FakeInstanceIDWithSubtype to javatests/ 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_driver_unittest.cc
diff --git a/components/gcm_driver/instance_id/instance_id_driver_unittest.cc b/components/gcm_driver/instance_id/instance_id_driver_unittest.cc
index 8997296aca9b1dad49e6749524421ca3094672b6..018f654be1f80dd32dbc62f47b99fdc338775879 100644
--- a/components/gcm_driver/instance_id/instance_id_driver_unittest.cc
+++ b/components/gcm_driver/instance_id/instance_id_driver_unittest.cc
@@ -15,8 +15,13 @@
#include "base/strings/string_util.h"
#include "components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.h"
#include "components/gcm_driver/instance_id/instance_id.h"
+#include "components/gcm_driver/instance_id/instance_id_test_utils_android.h"
Peter Beverloo 2016/04/15 00:00:18 Stick this in the #ifdef too?
johnme 2016/04/15 16:00:43 Done.
#include "testing/gtest/include/gtest/gtest.h"
+#if defined(OS_ANDROID)
+#include "components/gcm_driver/instance_id/instance_id_android.h"
+#endif // OS_ANDROID
+
namespace instance_id {
namespace {
@@ -105,6 +110,10 @@ InstanceIDDriverTest::~InstanceIDDriverTest() {
}
void InstanceIDDriverTest::SetUp() {
+#if defined(OS_ANDROID)
+ InstanceIDTestUtilsAndroid::ClearDataAndSetUseFakeForTesting(true);
+ InstanceIDAndroid::SetBlockOnAsyncTasksForTesting(true);
Peter Beverloo 2016/04/15 00:00:17 Clean up as part of TearDown? They're statics so t
johnme 2016/04/15 16:00:43 Done (I'd been hoping to avoid the boilerplate, as
+#endif // OS_ANDROID
gcm_driver_.reset(new FakeGCMDriverForInstanceID);
RecreateInstanceIDDriver();
}

Powered by Google App Engine
This is Rietveld 408576698