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

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

Issue 3388024: Fix memory problem in DecoderVerbatim (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 2 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/decoder_verbatim.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) 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 "media/base/video_frame.h" 5 #include "media/base/video_frame.h"
6 #include "remoting/base/codec_test.h" 6 #include "remoting/base/codec_test.h"
7 #include "remoting/base/decoder_verbatim.h" 7 #include "remoting/base/decoder_verbatim.h"
8 #include "remoting/base/encoder_verbatim.h" 8 #include "remoting/base/encoder_verbatim.h"
9 #include "remoting/client/mock_objects.h" 9 #include "remoting/client/mock_objects.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 15 matching lines...) Expand all
26 // Prepare the begin rect message. 26 // Prepare the begin rect message.
27 UpdateStreamBeginRect* begin_rect = 27 UpdateStreamBeginRect* begin_rect =
28 msg->mutable_update_stream_packet()->mutable_begin_rect(); 28 msg->mutable_update_stream_packet()->mutable_begin_rect();
29 begin_rect->set_width(kWidth); 29 begin_rect->set_width(kWidth);
30 begin_rect->set_height(kHeight); 30 begin_rect->set_height(kHeight);
31 begin_rect->set_x(0); 31 begin_rect->set_x(0);
32 begin_rect->set_y(0); 32 begin_rect->set_y(0);
33 begin_rect->set_pixel_format(PixelFormatAscii); 33 begin_rect->set_pixel_format(PixelFormatAscii);
34 34
35 // Prepare the rect data. 35 // Prepare the rect data.
36 msg->mutable_update_stream_packet()->mutable_rect_data()->set_data( 36 msg->mutable_update_stream_packet()->mutable_rect_data()->set_data(kData);
37 kData, sizeof(kData));
38 37
39 // Prepare the end rect. 38 // Prepare the end rect.
40 msg->mutable_update_stream_packet()->mutable_end_rect(); 39 msg->mutable_update_stream_packet()->mutable_end_rect();
41 40
42 scoped_refptr<media::VideoFrame> frame; 41 scoped_refptr<media::VideoFrame> frame;
43 media::VideoFrame::CreateFrame(media::VideoFrame::ASCII, kWidth, kHeight, 42 media::VideoFrame::CreateFrame(media::VideoFrame::ASCII, kWidth, kHeight,
44 base::TimeDelta(), base::TimeDelta(), &frame); 43 base::TimeDelta(), base::TimeDelta(), &frame);
45 ASSERT_TRUE(frame); 44 ASSERT_TRUE(frame);
46 45
47 InSequence s; 46 InSequence s;
(...skipping 21 matching lines...) Expand all
69 } 68 }
70 69
71 TEST(DecoderVerbatimTest, EncodeAndDecode) { 70 TEST(DecoderVerbatimTest, EncodeAndDecode) {
72 EncoderVerbatim encoder; 71 EncoderVerbatim encoder;
73 DecoderVerbatim decoder; 72 DecoderVerbatim decoder;
74 decoder.set_reverse_rows(false); 73 decoder.set_reverse_rows(false);
75 TestEncoderDecoder(&encoder, &decoder, true); 74 TestEncoderDecoder(&encoder, &decoder, true);
76 } 75 }
77 76
78 } // namespace remoting 77 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/decoder_verbatim.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698