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

Side by Side Diff: google_apis/gcm/engine/connection_handler_unittest.cc

Issue 51453003: Fix some warnings on gcc 4.7 on Linux. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 1 month 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 | « chrome/browser/devtools/devtools_adb_bridge_browsertest.cc ('k') | no next file » | 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/engine/connection_handler.h" 5 #include "google_apis/gcm/engine/connection_handler.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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 // ---- Helpers for building messages. ---- 45 // ---- Helpers for building messages. ----
46 46
47 // Encode a protobuf packet with protobuf type |tag| and serialized protobuf 47 // Encode a protobuf packet with protobuf type |tag| and serialized protobuf
48 // bytes |proto| into the MCS message form (tag + varint size + bytes). 48 // bytes |proto| into the MCS message form (tag + varint size + bytes).
49 std::string EncodePacket(uint8 tag, const std::string& proto) { 49 std::string EncodePacket(uint8 tag, const std::string& proto) {
50 std::string result; 50 std::string result;
51 google::protobuf::io::StringOutputStream string_output_stream(&result); 51 google::protobuf::io::StringOutputStream string_output_stream(&result);
52 google::protobuf::io::CodedOutputStream coded_output_stream( 52 google::protobuf::io::CodedOutputStream coded_output_stream(
53 &string_output_stream); 53 &string_output_stream);
54 const char tag_byte[1] = {tag}; 54 const unsigned char tag_byte[1] = {tag};
55 coded_output_stream.WriteRaw(tag_byte, 1); 55 coded_output_stream.WriteRaw(tag_byte, 1);
56 coded_output_stream.WriteVarint32(proto.size()); 56 coded_output_stream.WriteVarint32(proto.size());
57 coded_output_stream.WriteRaw(proto.c_str(), proto.size()); 57 coded_output_stream.WriteRaw(proto.c_str(), proto.size());
58 return result; 58 return result;
59 } 59 }
60 60
61 // Encode a handshake request into the MCS message form. 61 // Encode a handshake request into the MCS message form.
62 std::string EncodeHandshakeRequest() { 62 std::string EncodeHandshakeRequest() {
63 std::string result; 63 std::string result;
64 const char version_byte[1] = {kMCSVersion}; 64 const char version_byte[1] = {kMCSVersion};
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 data_message.set_category(kDataMsgCategory); 617 data_message.set_category(kDataMsgCategory);
618 connection_handler()->SendMessage(data_message); 618 connection_handler()->SendMessage(data_message);
619 EXPECT_FALSE(connection_handler()->CanSendMessage()); 619 EXPECT_FALSE(connection_handler()->CanSendMessage());
620 WaitForMessage(); // The message send. Should result in an error 620 WaitForMessage(); // The message send. Should result in an error
621 EXPECT_FALSE(connection_handler()->CanSendMessage()); 621 EXPECT_FALSE(connection_handler()->CanSendMessage());
622 EXPECT_EQ(net::ERR_CONNECTION_CLOSED, last_error()); 622 EXPECT_EQ(net::ERR_CONNECTION_CLOSED, last_error());
623 } 623 }
624 624
625 } // namespace 625 } // namespace
626 } // namespace gcm 626 } // namespace gcm
OLDNEW
« no previous file with comments | « chrome/browser/devtools/devtools_adb_bridge_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698