summaryrefslogtreecommitdiffstats
path: root/google_apis/gcm/engine/checkin_request_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'google_apis/gcm/engine/checkin_request_unittest.cc')
-rw-r--r--google_apis/gcm/engine/checkin_request_unittest.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/google_apis/gcm/engine/checkin_request_unittest.cc b/google_apis/gcm/engine/checkin_request_unittest.cc
index 12e9a60..6f1c630 100644
--- a/google_apis/gcm/engine/checkin_request_unittest.cc
+++ b/google_apis/gcm/engine/checkin_request_unittest.cc
@@ -53,6 +53,8 @@ const char kCheckinURL[] = "http://foo.bar/checkin";
const char kChromeVersion[] = "Version String";
const uint64 kSecurityToken = 77;
const char kSettingsDigest[] = "settings_digest";
+const char kEmailAddress[] = "test_user@gmail.com";
+const char kTokenValue[] = "token_value";
class CheckinRequestTest : public testing::Test {
public:
@@ -122,11 +124,14 @@ void CheckinRequestTest::CreateRequest(uint64 android_id,
checkin_proto::ChromeBuildProto::CHANNEL_CANARY);
chrome_build_proto_.set_chrome_version(kChromeVersion);
- CheckinRequest::RequestInfo request_info(
- android_id,
- security_token,
- kSettingsDigest,
- chrome_build_proto_);
+ std::map<std::string, std::string> account_tokens;
+ account_tokens[kEmailAddress] = kTokenValue;
+
+ CheckinRequest::RequestInfo request_info(android_id,
+ security_token,
+ account_tokens,
+ kSettingsDigest,
+ chrome_build_proto_);
// Then create a request with that protobuf and specified android_id,
// security_token.
request_.reset(new CheckinRequest(
@@ -199,6 +204,9 @@ TEST_F(CheckinRequestTest, FetcherDataAndURL) {
request_proto.checkin().chrome_build().chrome_version());
EXPECT_EQ(chrome_build_proto_.channel(),
request_proto.checkin().chrome_build().channel());
+ EXPECT_EQ(2, request_proto.account_cookie_size());
+ EXPECT_EQ(kEmailAddress, request_proto.account_cookie(0));
+ EXPECT_EQ(kTokenValue, request_proto.account_cookie(1));
#if defined(CHROME_OS)
EXPECT_EQ(checkin_proto::DEVICE_CHROME_OS, request_proto.checkin().type());