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

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

Issue 3011010: Unit test for Encoder / Decoder for remoting (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/decoder_verbatim.h ('k') | remoting/base/encoder_verbatim.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) 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/decoder_verbatim.h" 7 #include "remoting/base/decoder_verbatim.h"
8 #include "remoting/base/encoder_verbatim.h"
7 #include "remoting/client/mock_objects.h" 9 #include "remoting/client/mock_objects.h"
8 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
9 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
10 12
11 using ::testing::InSequence; 13 using ::testing::InSequence;
12 14
13 namespace remoting { 15 namespace remoting {
14 16
15 TEST(DecoderVerbatimTest, SimpleDecode) { 17 TEST(DecoderVerbatimTest, SimpleDecode) {
16 DecoderVerbatim decoder; 18 DecoderVerbatim decoder;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 NewRunnableMethod(handler.get(), 54 NewRunnableMethod(handler.get(),
53 &MockDecodeDoneHandler::PartialDecodeDone), 55 &MockDecodeDoneHandler::PartialDecodeDone),
54 NewRunnableMethod(handler.get(), &MockDecodeDoneHandler::DecodeDone)); 56 NewRunnableMethod(handler.get(), &MockDecodeDoneHandler::DecodeDone));
55 decoder.PartialDecode(msg.release()); 57 decoder.PartialDecode(msg.release());
56 decoder.EndDecode(); 58 decoder.EndDecode();
57 59
58 // Make sure we get the same data back. 60 // Make sure we get the same data back.
59 EXPECT_EQ(kWidth, frame->width()); 61 EXPECT_EQ(kWidth, frame->width());
60 EXPECT_EQ(kHeight, frame->height()); 62 EXPECT_EQ(kHeight, frame->height());
61 EXPECT_EQ(media::VideoFrame::ASCII, frame->format()); 63 EXPECT_EQ(media::VideoFrame::ASCII, frame->format());
62 // TODO(hclam): Enable this line.
63 // EXPECT_EQ(0, memcmp(kData, frame->data(media::VideoFrame::kRGBPlane),
64 // sizeof(kData)));
65 64
66 // Check the updated rects. 65 // Check the updated rects.
67 ASSERT_TRUE(rects.size() == 1); 66 ASSERT_TRUE(rects.size() == 1);
68 EXPECT_EQ(kWidth, static_cast<size_t>(rects[0].width())); 67 EXPECT_EQ(kWidth, static_cast<size_t>(rects[0].width()));
69 EXPECT_EQ(kHeight, static_cast<size_t>(rects[0].height())); 68 EXPECT_EQ(kHeight, static_cast<size_t>(rects[0].height()));
70 } 69 }
71 70
71 TEST(DecoderVerbatimTest, EncodeAndDecode) {
72 EncoderVerbatim encoder;
73 DecoderVerbatim decoder;
74 decoder.set_reverse_rows(false);
75 TestEncoderDecoder(&encoder, &decoder, true);
76 }
77
72 } // namespace remoting 78 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/decoder_verbatim.h ('k') | remoting/base/encoder_verbatim.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698