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

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

Issue 2847923002: [Chromecast] Add method to CastCdm for the session expiration updating. (Closed)
Patch Set: Add InstanceIDFactory class to help with testing. Created 3 years, 5 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 86f275e1f0fd8504722539c1e33e64126160ec54..62b77c9aacd59e3b4cf360f77b1760dc66ca93c0 100644
--- a/components/gcm_driver/instance_id/instance_id_driver_unittest.cc
+++ b/components/gcm_driver/instance_id/instance_id_driver_unittest.cc
@@ -16,6 +16,7 @@
#include "components/gcm_driver/gcm_build_features.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_impl_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(USE_GCM_FROM_PLATFORM)
@@ -90,6 +91,7 @@ class InstanceIDDriverTest : public testing::Test {
base::test::ScopedTaskEnvironment scoped_task_environment_;
std::unique_ptr<FakeGCMDriverForInstanceID> gcm_driver_;
+ std::unique_ptr<InstanceIDImplFactory> instance_id_factory_;
std::unique_ptr<InstanceIDDriver> driver_;
#if BUILDFLAG(USE_GCM_FROM_PLATFORM)
@@ -119,11 +121,13 @@ InstanceIDDriverTest::~InstanceIDDriverTest() {
void InstanceIDDriverTest::SetUp() {
gcm_driver_.reset(new FakeGCMDriverForInstanceID);
+ instance_id_factory_.reset(new InstanceIDImplFactory);
RecreateInstanceIDDriver();
}
void InstanceIDDriverTest::TearDown() {
driver_.reset();
+ instance_id_factory_.reset();
gcm_driver_.reset();
// |gcm_driver_| owns a GCMKeyStore that owns a ProtoDatabaseImpl whose
// destructor deletes the underlying LevelDB on the task runner.
@@ -131,7 +135,8 @@ void InstanceIDDriverTest::TearDown() {
}
void InstanceIDDriverTest::RecreateInstanceIDDriver() {
- driver_.reset(new InstanceIDDriver(gcm_driver_.get()));
+ driver_.reset(
+ new InstanceIDDriver(gcm_driver_.get(), instance_id_factory_.get()));
}
void InstanceIDDriverTest::WaitForAsyncOperation() {
« no previous file with comments | « components/gcm_driver/instance_id/instance_id_driver.cc ('k') | components/gcm_driver/instance_id/instance_id_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698