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

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

Issue 2230193002: remoting: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 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') | remoting/protocol/message_reader_unittest.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 (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 "remoting/protocol/message_decoder.h" 5 #include "remoting/protocol/message_decoder.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 EventMessage* message = *it; 100 EventMessage* message = *it;
101 // Partial update stream. 101 // Partial update stream.
102 EXPECT_TRUE(message->has_key_event()); 102 EXPECT_TRUE(message->has_key_event());
103 103
104 // TODO(sergeyu): Don't use index here. Instead store the expected values 104 // TODO(sergeyu): Don't use index here. Instead store the expected values
105 // in an array. 105 // in an array.
106 EXPECT_EQ(kTestKey + index, message->key_event().usb_keycode()); 106 EXPECT_EQ(kTestKey + index, message->key_event().usb_keycode());
107 EXPECT_EQ((index % 2) != 0, message->key_event().pressed()); 107 EXPECT_EQ((index % 2) != 0, message->key_event().pressed());
108 ++index; 108 ++index;
109 } 109 }
110 STLDeleteElements(&message_list); 110 base::STLDeleteElements(&message_list);
111 } 111 }
112 112
113 TEST(MessageDecoderTest, SmallReads) { 113 TEST(MessageDecoderTest, SmallReads) {
114 const int kReads[] = {1, 2, 3, 1}; 114 const int kReads[] = {1, 2, 3, 1};
115 SimulateReadSequence(kReads, arraysize(kReads)); 115 SimulateReadSequence(kReads, arraysize(kReads));
116 } 116 }
117 117
118 TEST(MessageDecoderTest, LargeReads) { 118 TEST(MessageDecoderTest, LargeReads) {
119 const int kReads[] = {50, 50, 5}; 119 const int kReads[] = {50, 50, 5};
120 SimulateReadSequence(kReads, arraysize(kReads)); 120 SimulateReadSequence(kReads, arraysize(kReads));
121 } 121 }
122 122
123 TEST(MessageDecoderTest, EmptyReads) { 123 TEST(MessageDecoderTest, EmptyReads) {
124 const int kReads[] = {4, 0, 50, 0}; 124 const int kReads[] = {4, 0, 50, 0};
125 SimulateReadSequence(kReads, arraysize(kReads)); 125 SimulateReadSequence(kReads, arraysize(kReads));
126 } 126 }
127 127
128 } // namespace protocol 128 } // namespace protocol
129 } // namespace remoting 129 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/jingle_session.cc ('k') | remoting/protocol/message_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698