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

Unified Diff: chrome/browser/services/gcm/gcm_profile_service_unittest.cc

Issue 270873002: Extract GCMClient data types into separate gcm_types.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reupload Created 6 years, 7 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
« no previous file with comments | « chrome/browser/services/gcm/gcm_client_mock.cc ('k') | chrome/browser/services/gcm/gcm_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/services/gcm/gcm_profile_service_unittest.cc
diff --git a/chrome/browser/services/gcm/gcm_profile_service_unittest.cc b/chrome/browser/services/gcm/gcm_profile_service_unittest.cc
index 6fef486dbb9f04e4dcb8f58d5c7dd92d599b757f..5b983868f1323240d9448325992e529459ad4cb9 100644
--- a/chrome/browser/services/gcm/gcm_profile_service_unittest.cc
+++ b/chrome/browser/services/gcm/gcm_profile_service_unittest.cc
@@ -49,23 +49,23 @@ class GCMProfileServiceTest : public testing::Test {
GCMClientMock* GetGCMClient() const;
void RegisterAndWaitForCompletion(const std::vector<std::string>& sender_ids);
- void SendAndWaitForCompletion(const GCMClient::OutgoingMessage& message);
+ void SendAndWaitForCompletion(const OutgoingMessage& message);
void RegisterCompleted(const base::Closure& callback,
const std::string& registration_id,
- GCMClient::Result result);
+ Result result);
void SendCompleted(const base::Closure& callback,
const std::string& message_id,
- GCMClient::Result result);
+ Result result);
content::TestBrowserThreadBundle thread_bundle_;
scoped_ptr<TestingProfile> profile_;
GCMProfileService* gcm_profile_service_;
std::string registration_id_;
- GCMClient::Result registration_result_;
+ Result registration_result_;
std::string send_message_id_;
- GCMClient::Result send_result_;
+ Result send_result_;
private:
DISALLOW_COPY_AND_ASSIGN(GCMProfileServiceTest);
@@ -73,8 +73,8 @@ class GCMProfileServiceTest : public testing::Test {
GCMProfileServiceTest::GCMProfileServiceTest()
: gcm_profile_service_(NULL),
- registration_result_(GCMClient::UNKNOWN_ERROR),
- send_result_(GCMClient::UNKNOWN_ERROR) {
+ registration_result_(RESULT_UNKNOWN_ERROR),
+ send_result_(RESULT_UNKNOWN_ERROR) {
}
GCMProfileServiceTest::~GCMProfileServiceTest() {
@@ -117,7 +117,7 @@ void GCMProfileServiceTest::RegisterAndWaitForCompletion(
}
void GCMProfileServiceTest::SendAndWaitForCompletion(
- const GCMClient::OutgoingMessage& message) {
+ const OutgoingMessage& message) {
base::RunLoop run_loop;
gcm_profile_service_->Send(kTestAppID,
kUserID,
@@ -131,7 +131,7 @@ void GCMProfileServiceTest::SendAndWaitForCompletion(
void GCMProfileServiceTest::RegisterCompleted(
const base::Closure& callback,
const std::string& registration_id,
- GCMClient::Result result) {
+ Result result) {
registration_id_ = registration_id;
registration_result_ = result;
callback.Run();
@@ -140,7 +140,7 @@ void GCMProfileServiceTest::RegisterCompleted(
void GCMProfileServiceTest::SendCompleted(
const base::Closure& callback,
const std::string& message_id,
- GCMClient::Result result) {
+ Result result) {
send_message_id_ = message_id;
send_result_ = result;
callback.Run();
@@ -164,7 +164,7 @@ TEST_F(GCMProfileServiceTest, RegisterUnderNeutralChannelSignal) {
std::string expected_registration_id =
GCMClientMock::GetRegistrationIdFromSenderIds(sender_ids);
EXPECT_EQ(expected_registration_id, registration_id_);
- EXPECT_EQ(GCMClient::SUCCESS, registration_result_);
+ EXPECT_EQ(RESULT_SUCCESS, registration_result_);
}
TEST_F(GCMProfileServiceTest, SendUnderNeutralChannelSignal) {
@@ -173,7 +173,7 @@ TEST_F(GCMProfileServiceTest, SendUnderNeutralChannelSignal) {
EXPECT_EQ(GCMClientMock::UNINITIALIZED, GetGCMClient()->status());
// Invoking send will make GCMClient checked in.
- GCMClient::OutgoingMessage message;
+ OutgoingMessage message;
message.id = "1";
message.data["key1"] = "value1";
SendAndWaitForCompletion( message);
@@ -184,7 +184,7 @@ TEST_F(GCMProfileServiceTest, SendUnderNeutralChannelSignal) {
// Sending should succeed.
EXPECT_EQ(message.id, send_message_id_);
- EXPECT_EQ(GCMClient::SUCCESS, send_result_);
+ EXPECT_EQ(RESULT_SUCCESS, send_result_);
}
} // namespace gcm
« no previous file with comments | « chrome/browser/services/gcm/gcm_client_mock.cc ('k') | chrome/browser/services/gcm/gcm_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698