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

Side by Side Diff: remoting/base/protocol_decoder_unittest.cc

Issue 2963003: Changing UpdateStreamPacket protobuf definition for chromoting (Closed)
Patch Set: fixed comments Created 10 years, 5 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/base/protocol/chromotocol.proto ('k') | remoting/client/decoder.h » ('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) 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 "media/base/data_buffer.h" 8 #include "media/base/data_buffer.h"
9 #include "remoting/base/protocol_decoder.h" 9 #include "remoting/base/protocol_decoder.h"
10 #include "remoting/base/protocol_util.h" 10 #include "remoting/base/protocol_util.h"
(...skipping 25 matching lines...) Expand all
36 msg.mutable_init_client()->set_height(kHeight); 36 msg.mutable_init_client()->set_height(kHeight);
37 AppendMessage(msg, &encoded_data); 37 AppendMessage(msg, &encoded_data);
38 msg.Clear(); 38 msg.Clear();
39 39
40 // Then append 10 update sequences to the data. 40 // Then append 10 update sequences to the data.
41 for (int i = 0; i < 10; ++i) { 41 for (int i = 0; i < 10; ++i) {
42 msg.mutable_begin_update_stream(); 42 msg.mutable_begin_update_stream();
43 AppendMessage(msg, &encoded_data); 43 AppendMessage(msg, &encoded_data);
44 msg.Clear(); 44 msg.Clear();
45 45
46 msg.mutable_update_stream_packet()->set_data(kTestData); 46 msg.mutable_update_stream_packet()->mutable_rect_data()->
47 set_sequence_number(0);
48 msg.mutable_update_stream_packet()->mutable_rect_data()->
49 set_data(kTestData);
47 AppendMessage(msg, &encoded_data); 50 AppendMessage(msg, &encoded_data);
48 msg.Clear(); 51 msg.Clear();
49 52
50 msg.mutable_end_update_stream(); 53 msg.mutable_end_update_stream();
51 AppendMessage(msg, &encoded_data); 54 AppendMessage(msg, &encoded_data);
52 msg.Clear(); 55 msg.Clear();
53 } 56 }
54 57
55 *size = encoded_data.length(); 58 *size = encoded_data.length();
56 *buffer = new uint8[*size]; 59 *buffer = new uint8[*size];
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 delete message_list[0]; 97 delete message_list[0];
95 98
96 for (size_t i = 1; i < message_list.size(); ++i) { 99 for (size_t i = 1; i < message_list.size(); ++i) {
97 int type = (i - 1) % 3; 100 int type = (i - 1) % 3;
98 if (type == 0) { 101 if (type == 0) {
99 // Begin update stream. 102 // Begin update stream.
100 EXPECT_TRUE(message_list[i]->has_begin_update_stream()); 103 EXPECT_TRUE(message_list[i]->has_begin_update_stream());
101 } else if (type == 1) { 104 } else if (type == 1) {
102 // Partial update stream. 105 // Partial update stream.
103 EXPECT_TRUE(message_list[i]->has_update_stream_packet()); 106 EXPECT_TRUE(message_list[i]->has_update_stream_packet());
104 EXPECT_EQ(kTestData, message_list[i]->update_stream_packet().data()); 107 EXPECT_EQ(kTestData,
108 message_list[i]->update_stream_packet().rect_data().data());
105 } else if (type == 2) { 109 } else if (type == 2) {
106 // End update stream. 110 // End update stream.
107 EXPECT_TRUE(message_list[i]->has_end_update_stream()); 111 EXPECT_TRUE(message_list[i]->has_end_update_stream());
108 } 112 }
109 delete message_list[i]; 113 delete message_list[i];
110 } 114 }
111 } 115 }
112 116
113 } // namespace remoting 117 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/protocol/chromotocol.proto ('k') | remoting/client/decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698