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

Side by Side Diff: google_apis/gcm/base/mcs_util_unittest.cc

Issue 1488933002: Misc fixes for gn builds with VS 2015 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable C4267 for VC++ 2015 builds only Created 5 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 unified diff | Download patch
« no previous file with comments | « build/config/compiler/BUILD.gn ('k') | gpu/command_buffer/client/query_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "google_apis/gcm/base/mcs_util.h" 5 #include "google_apis/gcm/base/mcs_util.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 13 matching lines...) Expand all
24 ASSERT_EQ(base::Uint64ToString(kAuthToken), login_request->auth_token()); 24 ASSERT_EQ(base::Uint64ToString(kAuthToken), login_request->auth_token());
25 ASSERT_EQ(base::Uint64ToString(kAuthId), login_request->user()); 25 ASSERT_EQ(base::Uint64ToString(kAuthId), login_request->user());
26 ASSERT_EQ("android-3d5c23dac2a1fa7c", login_request->device_id()); 26 ASSERT_EQ("android-3d5c23dac2a1fa7c", login_request->device_id());
27 ASSERT_EQ("new_vc", login_request->setting(0).name()); 27 ASSERT_EQ("new_vc", login_request->setting(0).name());
28 ASSERT_EQ("1", login_request->setting(0).value()); 28 ASSERT_EQ("1", login_request->setting(0).value());
29 // TODO(zea): test the other fields once they have valid values. 29 // TODO(zea): test the other fields once they have valid values.
30 } 30 }
31 31
32 // Test building a protobuf and extracting the tag from a protobuf. 32 // Test building a protobuf and extracting the tag from a protobuf.
33 TEST(MCSUtilTest, ProtobufToTag) { 33 TEST(MCSUtilTest, ProtobufToTag) {
34 for (size_t i = 0; i < kNumProtoTypes; ++i) { 34 for (uint8 i = 0; i < kNumProtoTypes; ++i) {
35 scoped_ptr<google::protobuf::MessageLite> protobuf = 35 scoped_ptr<google::protobuf::MessageLite> protobuf =
36 BuildProtobufFromTag(i); 36 BuildProtobufFromTag(i);
37 if (!protobuf.get()) // Not all tags have protobuf definitions. 37 if (!protobuf.get()) // Not all tags have protobuf definitions.
38 continue; 38 continue;
39 ASSERT_EQ((int)i, GetMCSProtoTag(*protobuf)) << "Type " << i; 39 ASSERT_EQ(i, GetMCSProtoTag(*protobuf)) << "Type " << i;
40 } 40 }
41 } 41 }
42 42
43 // Test getting and setting persistent ids. 43 // Test getting and setting persistent ids.
44 TEST(MCSUtilTest, PersistentIds) { 44 TEST(MCSUtilTest, PersistentIds) {
45 static_assert(kNumProtoTypes == 16U, "Update Persistent Ids"); 45 static_assert(kNumProtoTypes == 16U, "Update Persistent Ids");
46 const int kTagsWithPersistentIds[] = { 46 const int kTagsWithPersistentIds[] = {
47 kIqStanzaTag, 47 kIqStanzaTag,
48 kDataMessageStanzaTag 48 kDataMessageStanzaTag
49 }; 49 };
(...skipping 25 matching lines...) Expand all
75 BuildProtobufFromTag(tag); 75 BuildProtobufFromTag(tag);
76 ASSERT_TRUE(protobuf.get()); 76 ASSERT_TRUE(protobuf.get());
77 SetLastStreamIdReceived(tag, protobuf.get()); 77 SetLastStreamIdReceived(tag, protobuf.get());
78 int get_id = GetLastStreamIdReceived(*protobuf); 78 int get_id = GetLastStreamIdReceived(*protobuf);
79 ASSERT_EQ(tag, get_id); 79 ASSERT_EQ(tag, get_id);
80 } 80 }
81 } 81 }
82 82
83 } // namespace 83 } // namespace
84 } // namespace gcm 84 } // namespace gcm
OLDNEW
« no previous file with comments | « build/config/compiler/BUILD.gn ('k') | gpu/command_buffer/client/query_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698