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

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

Issue 1359453003: Use the appropriate variant of IntToString in //remoting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use the full range of uint64 in RandGenerator. Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « remoting/protocol/jingle_session.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "remoting/proto/event.pb.h" 10 #include "remoting/proto/event.pb.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 pos += read; 84 pos += read;
85 } 85 }
86 86
87 // Then verify the decoded messages. 87 // Then verify the decoded messages.
88 EXPECT_EQ(10u, message_list.size()); 88 EXPECT_EQ(10u, message_list.size());
89 89
90 unsigned int index = 0; 90 unsigned int index = 0;
91 for (std::list<EventMessage*>::iterator it = 91 for (std::list<EventMessage*>::iterator it =
92 message_list.begin(); 92 message_list.begin();
93 it != message_list.end(); ++it) { 93 it != message_list.end(); ++it) {
94 SCOPED_TRACE("Message " + base::IntToString(index)); 94 SCOPED_TRACE("Message " + base::UintToString(index));
95 95
96 EventMessage* message = *it; 96 EventMessage* message = *it;
97 // Partial update stream. 97 // Partial update stream.
98 EXPECT_TRUE(message->has_key_event()); 98 EXPECT_TRUE(message->has_key_event());
99 99
100 // TODO(sergeyu): Don't use index here. Instead store the expected values 100 // TODO(sergeyu): Don't use index here. Instead store the expected values
101 // in an array. 101 // in an array.
102 EXPECT_EQ(kTestKey + index, message->key_event().usb_keycode()); 102 EXPECT_EQ(kTestKey + index, message->key_event().usb_keycode());
103 EXPECT_EQ((index % 2) != 0, message->key_event().pressed()); 103 EXPECT_EQ((index % 2) != 0, message->key_event().pressed());
104 ++index; 104 ++index;
(...skipping 11 matching lines...) Expand all
116 SimulateReadSequence(kReads, arraysize(kReads)); 116 SimulateReadSequence(kReads, arraysize(kReads));
117 } 117 }
118 118
119 TEST(MessageDecoderTest, EmptyReads) { 119 TEST(MessageDecoderTest, EmptyReads) {
120 const int kReads[] = {4, 0, 50, 0}; 120 const int kReads[] = {4, 0, 50, 0};
121 SimulateReadSequence(kReads, arraysize(kReads)); 121 SimulateReadSequence(kReads, arraysize(kReads));
122 } 122 }
123 123
124 } // namespace protocol 124 } // namespace protocol
125 } // namespace remoting 125 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/jingle_session.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698