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

Side by Side Diff: remoting/protocol/message_decoder_unittest.cc

Issue 5068001: Move move classes to the remoting::protocol namespace. Minor cleanups. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more fixes for windows Created 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <string> 5 #include <string>
6 6
7 #include "base/scoped_ptr.h" 7 #include "base/scoped_ptr.h"
8 #include "base/stl_util-inl.h" 8 #include "base/stl_util-inl.h"
9 #include "remoting/proto/internal.pb.h" 9 #include "remoting/proto/internal.pb.h"
10 #include "remoting/protocol/message_decoder.h" 10 #include "remoting/protocol/message_decoder.h"
11 #include "remoting/protocol/util.h" 11 #include "remoting/protocol/util.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace remoting { 14 namespace remoting {
15 namespace protocol {
15 16
16 static const int kTestKey = 142; 17 static const int kTestKey = 142;
17 18
18 static void AppendMessage(const ChromotingClientMessage& msg, 19 static void AppendMessage(const ChromotingClientMessage& msg,
19 std::string* buffer) { 20 std::string* buffer) {
20 // Contains one encoded message. 21 // Contains one encoded message.
21 scoped_refptr<net::IOBufferWithSize> encoded_msg; 22 scoped_refptr<net::IOBufferWithSize> encoded_msg;
22 encoded_msg = SerializeAndFrameMessage(msg); 23 encoded_msg = SerializeAndFrameMessage(msg);
23 buffer->append(encoded_msg->data(), encoded_msg->size()); 24 buffer->append(encoded_msg->data(), encoded_msg->size());
24 } 25 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 TEST(MessageDecoderTest, LargeReads) { 99 TEST(MessageDecoderTest, LargeReads) {
99 const int kReads[] = {50, 50, 5}; 100 const int kReads[] = {50, 50, 5};
100 SimulateReadSequence(kReads, arraysize(kReads)); 101 SimulateReadSequence(kReads, arraysize(kReads));
101 } 102 }
102 103
103 TEST(MessageDecoderTest, EmptyReads) { 104 TEST(MessageDecoderTest, EmptyReads) {
104 const int kReads[] = {4, 0, 50, 0}; 105 const int kReads[] = {4, 0, 50, 0};
105 SimulateReadSequence(kReads, arraysize(kReads)); 106 SimulateReadSequence(kReads, arraysize(kReads));
106 } 107 }
107 108
109 } // namespace protocol
108 } // namespace remoting 110 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698