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

Unified Diff: components/gcm_driver/gcm_driver_desktop_unittest.cc

Issue 442123003: [GCM] Adding the OnSendAcknowledgement event (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing code review comments. Created 6 years, 4 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 | « components/gcm_driver/gcm_driver_desktop.cc ('k') | components/invalidation/gcm_invalidation_bridge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/gcm_driver_desktop_unittest.cc
diff --git a/components/gcm_driver/gcm_driver_desktop_unittest.cc b/components/gcm_driver/gcm_driver_desktop_unittest.cc
index 1039b3172c1cec8d6b7fb728260c6863fead9fc7..495e2c400909ff18872110f2c1ba1303a86710a0 100644
--- a/components/gcm_driver/gcm_driver_desktop_unittest.cc
+++ b/components/gcm_driver/gcm_driver_desktop_unittest.cc
@@ -229,9 +229,9 @@ void GCMDriverTest::Register(const std::string& app_id,
base::RunLoop run_loop;
async_operation_completed_callback_ = run_loop.QuitClosure();
driver_->Register(app_id,
- sender_ids,
- base::Bind(&GCMDriverTest::RegisterCompleted,
- base::Unretained(this)));
+ sender_ids,
+ base::Bind(&GCMDriverTest::RegisterCompleted,
+ base::Unretained(this)));
if (wait_to_finish == WAIT)
run_loop.Run();
}
@@ -243,10 +243,10 @@ void GCMDriverTest::Send(const std::string& app_id,
base::RunLoop run_loop;
async_operation_completed_callback_ = run_loop.QuitClosure();
driver_->Send(app_id,
- receiver_id,
- message,
- base::Bind(&GCMDriverTest::SendCompleted,
- base::Unretained(this)));
+ receiver_id,
+ message,
+ base::Bind(&GCMDriverTest::SendCompleted,
+ base::Unretained(this)));
if (wait_to_finish == WAIT)
run_loop.Run();
}
@@ -797,13 +797,17 @@ TEST_F(GCMDriverFunctionalTest, RegisterWhenAsyncOperationPending) {
TEST_F(GCMDriverFunctionalTest, Send) {
GCMClient::OutgoingMessage message;
- message.id = "1";
+ message.id = "1@ack";
message.data["key1"] = "value1";
message.data["key2"] = "value2";
Send(kTestAppID1, kUserID1, message, GCMDriverTest::WAIT);
EXPECT_EQ(message.id, send_message_id());
EXPECT_EQ(GCMClient::SUCCESS, send_result());
+
+ gcm_app_handler()->WaitForNotification();
+ EXPECT_EQ(message.id, gcm_app_handler()->acked_message_id());
+ EXPECT_EQ(kTestAppID1, gcm_app_handler()->app_id());
}
TEST_F(GCMDriverFunctionalTest, SendAfterSignOut) {
« no previous file with comments | « components/gcm_driver/gcm_driver_desktop.cc ('k') | components/invalidation/gcm_invalidation_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698