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

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

Issue 171513004: [GCM] Adding a list of accounts present on the client to checkin request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix to android test issue Created 6 years, 10 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 | « google_apis/gcm/engine/checkin_request.cc ('k') | google_apis/gcm/gcm_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/engine/checkin_request_unittest.cc
diff --git a/google_apis/gcm/engine/checkin_request_unittest.cc b/google_apis/gcm/engine/checkin_request_unittest.cc
index ba77f9f7be13b8c90776cde9830f0307259f775a..0142e0ca4f135b1ebf3f599d2f781c25953c1559 100644
--- a/google_apis/gcm/engine/checkin_request_unittest.cc
+++ b/google_apis/gcm/engine/checkin_request_unittest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <string>
+#include <vector>
#include "google_apis/gcm/engine/checkin_request.h"
#include "google_apis/gcm/protocol/checkin.pb.h"
@@ -85,6 +86,7 @@ class CheckinRequestTest : public testing::Test {
net::TestURLFetcherFactory url_fetcher_factory_;
scoped_refptr<net::TestURLRequestContextGetter> url_request_context_getter_;
checkin_proto::ChromeBuildProto chrome_build_proto_;
+ std::vector<std::string> account_ids_;
scoped_ptr<CheckinRequest> request_;
};
@@ -94,7 +96,9 @@ CheckinRequestTest::CheckinRequestTest()
security_token_(kBlankSecurityToken),
checkin_device_type_(0),
url_request_context_getter_(new net::TestURLRequestContextGetter(
- message_loop_.message_loop_proxy())) {}
+ message_loop_.message_loop_proxy())) {
+ account_ids_.push_back("account_id");
+}
CheckinRequestTest::~CheckinRequestTest() {}
@@ -116,12 +120,12 @@ void CheckinRequestTest::CreateRequest(uint64 android_id,
// Then create a request with that protobuf and specified android_id,
// security_token.
request_.reset(new CheckinRequest(
- base::Bind(&CheckinRequestTest::FetcherCallback,
- base::Unretained(this)),
+ base::Bind(&CheckinRequestTest::FetcherCallback, base::Unretained(this)),
kDefaultBackoffPolicy,
chrome_build_proto_,
android_id,
security_token,
+ account_ids_,
url_request_context_getter_.get()));
// Setting android_id_ and security_token_ to blank value, not used elsewhere
@@ -193,6 +197,9 @@ TEST_F(CheckinRequestTest, FetcherData) {
EXPECT_EQ(checkin_proto::DEVICE_CHROME_BROWSER,
request_proto.checkin().type());
#endif
+
+ EXPECT_EQ(1, request_proto.account_cookie_size());
+ EXPECT_EQ("[account_id]", request_proto.account_cookie(0));
}
TEST_F(CheckinRequestTest, ResponseBodyEmpty) {
« no previous file with comments | « google_apis/gcm/engine/checkin_request.cc ('k') | google_apis/gcm/gcm_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698