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

Unified Diff: google_apis/gcm/engine/mcs_client_unittest.cc

Issue 121743002: Renaming RMQStore to GCMStore and breaking out its interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates to documentation and test method naming Created 7 years 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: google_apis/gcm/engine/mcs_client_unittest.cc
diff --git a/google_apis/gcm/engine/mcs_client_unittest.cc b/google_apis/gcm/engine/mcs_client_unittest.cc
index 0dcf2989b76137a38a431af91413830b716afdf9..3a928c6d55477b4e6f22ae10e358bfd71fa32310 100644
--- a/google_apis/gcm/engine/mcs_client_unittest.cc
+++ b/google_apis/gcm/engine/mcs_client_unittest.cc
@@ -12,6 +12,7 @@
#include "google_apis/gcm/base/mcs_util.h"
#include "google_apis/gcm/engine/fake_connection_factory.h"
#include "google_apis/gcm/engine/fake_connection_handler.h"
+#include "google_apis/gcm/engine/gcm_store_impl.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace gcm {
@@ -47,11 +48,8 @@ MCSMessage BuildDataMessage(const std::string& from,
// MCSClient with overriden exposed persistent id logic.
class TestMCSClient : public MCSClient {
public:
- TestMCSClient(ConnectionFactory* connection_factory,
- RMQStore* rmq_store)
- : MCSClient(connection_factory, rmq_store),
- next_id_(0) {
- }
+ TestMCSClient(ConnectionFactory* connection_factory, GCMStore* gcm_store)
+ : MCSClient(connection_factory, gcm_store), next_id_(0) {}
virtual std::string GetNextPersistentId() OVERRIDE {
return base::UintToString(++next_id_);
@@ -95,7 +93,7 @@ class MCSClientTest : public testing::Test {
base::ScopedTempDir temp_directory_;
base::MessageLoop message_loop_;
scoped_ptr<base::RunLoop> run_loop_;
- scoped_ptr<RMQStore> rmq_store_;
+ scoped_ptr<GCMStore> gcm_store_;
FakeConnectionFactory connection_factory_;
scoped_ptr<TestMCSClient> mcs_client_;
@@ -123,21 +121,20 @@ MCSClientTest::MCSClientTest()
MCSClientTest::~MCSClientTest() {}
void MCSClientTest::BuildMCSClient() {
- rmq_store_.reset(new RMQStore(temp_directory_.path(),
- message_loop_.message_loop_proxy()));
- mcs_client_.reset(new TestMCSClient(&connection_factory_, rmq_store_.get()));
+ gcm_store_.reset(new GCMStoreImpl(temp_directory_.path(),
+ message_loop_.message_loop_proxy()));
+ mcs_client_.reset(new TestMCSClient(&connection_factory_, gcm_store_.get()));
}
void MCSClientTest::InitializeClient() {
- rmq_store_->Load(
- base::Bind(&MCSClient::Initialize,
- base::Unretained(mcs_client_.get()),
- base::Bind(&MCSClientTest::InitializationCallback,
- base::Unretained(this)),
- base::Bind(&MCSClientTest::MessageReceivedCallback,
- base::Unretained(this)),
- base::Bind(&MCSClientTest::MessageSentCallback,
- base::Unretained(this))));
+ gcm_store_->Load(base::Bind(
+ &MCSClient::Initialize,
+ base::Unretained(mcs_client_.get()),
+ base::Bind(&MCSClientTest::InitializationCallback,
+ base::Unretained(this)),
+ base::Bind(&MCSClientTest::MessageReceivedCallback,
+ base::Unretained(this)),
+ base::Bind(&MCSClientTest::MessageSentCallback, base::Unretained(this))));
run_loop_->Run();
run_loop_.reset(new base::RunLoop());
}
@@ -208,7 +205,7 @@ TEST_F(MCSClientTest, InitializeExisting) {
InitializeClient();
LoginClient(std::vector<std::string>());
- // Rebuild the client, to reload from the RMQ.
+ // Rebuild the client, to reload from the GCM store.
BuildMCSClient();
InitializeClient();
EXPECT_EQ(kAndroidId, restored_android_id());

Powered by Google App Engine
This is Rietveld 408576698