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

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: 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_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..759299fcd8e60b89999ad1072945df86a2c1d1cb 100644
--- a/components/gcm_driver/instance_id/instance_id_driver_unittest.cc
+++ b/components/gcm_driver/instance_id/instance_id_driver_unittest.cc
@@ -17,6 +17,11 @@
#include "components/gcm_driver/instance_id/instance_id.h"
#include "testing/gtest/include/gtest/gtest.h"
+#if defined(OS_ANDROID)
+#include "components/gcm_driver/instance_id/instance_id_android.h"
+#include "components/gcm_driver/instance_id/scoped_use_fake_instance_id_android.h"
+#endif // OS_ANDROID
+
namespace instance_id {
namespace {
@@ -52,6 +57,7 @@ class InstanceIDDriverTest : public testing::Test {
// testing::Test:
void SetUp() override;
+ void TearDown() override;
void WaitForAsyncOperation();
@@ -85,6 +91,11 @@ class InstanceIDDriverTest : public testing::Test {
scoped_ptr<FakeGCMDriverForInstanceID> gcm_driver_;
scoped_ptr<InstanceIDDriver> driver_;
+#if defined(OS_ANDROID)
+ InstanceIDAndroid::ScopedBlockOnAsyncTasksForTesting block_async_;
+ ScopedUseFakeInstanceIDAndroid use_fake_;
+#endif // OS_ANDROID
+
std::string id_;
base::Time creation_time_;
std::string token_;
@@ -109,6 +120,8 @@ void InstanceIDDriverTest::SetUp() {
RecreateInstanceIDDriver();
}
+void InstanceIDDriverTest::TearDown() {}
+
void InstanceIDDriverTest::RecreateInstanceIDDriver() {
driver_.reset(new InstanceIDDriver(gcm_driver_.get()));
}

Powered by Google App Engine
This is Rietveld 408576698