OLD | NEW |
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 <deque> |
5 #include <stdlib.h> | 6 #include <stdlib.h> |
6 | 7 |
7 #include <deque> | |
8 | |
9 #include "base/task.h" | |
10 #include "gfx/rect.h" | 8 #include "gfx/rect.h" |
11 #include "media/base/video_frame.h" | 9 #include "media/base/video_frame.h" |
12 #include "remoting/base/codec_test.h" | 10 #include "remoting/base/codec_test.h" |
13 #include "remoting/base/decoder.h" | 11 #include "remoting/base/decoder.h" |
14 #include "remoting/base/encoder.h" | 12 #include "remoting/base/encoder.h" |
15 #include "remoting/base/mock_objects.h" | 13 #include "remoting/base/mock_objects.h" |
16 #include "remoting/base/util.h" | 14 #include "remoting/base/util.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
18 | 16 |
19 static const int kWidth = 320; | 17 static const int kWidth = 320; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 State state_; | 146 State state_; |
149 bool strict_; | 147 bool strict_; |
150 | 148 |
151 std::deque<gfx::Rect> rects_; | 149 std::deque<gfx::Rect> rects_; |
152 | 150 |
153 DISALLOW_COPY_AND_ASSIGN(EncoderMessageTester); | 151 DISALLOW_COPY_AND_ASSIGN(EncoderMessageTester); |
154 }; | 152 }; |
155 | 153 |
156 class DecoderTester { | 154 class DecoderTester { |
157 public: | 155 public: |
158 explicit DecoderTester(Decoder* decoder) | 156 DecoderTester(Decoder* decoder) |
159 : strict_(false), | 157 : strict_(false), |
160 decoder_(decoder), | 158 decoder_(decoder), |
161 decode_done_(false) { | 159 decode_done_(false) { |
162 media::VideoFrame::CreateFrame(media::VideoFrame::RGB32, | 160 media::VideoFrame::CreateFrame(media::VideoFrame::RGB32, |
163 kWidth, kHeight, | 161 kWidth, kHeight, |
164 base::TimeDelta(), | 162 base::TimeDelta(), |
165 base::TimeDelta(), &frame_); | 163 base::TimeDelta(), &frame_); |
166 EXPECT_TRUE(frame_.get()); | 164 EXPECT_TRUE(frame_.get()); |
167 } | 165 } |
168 | 166 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 TestEncodingRects(encoder, &encoder_tester, &decoder_tester, data, | 425 TestEncodingRects(encoder, &encoder_tester, &decoder_tester, data, |
428 kTestRects + 2, 1); | 426 kTestRects + 2, 1); |
429 TestEncodingRects(encoder, &encoder_tester, &decoder_tester, data, | 427 TestEncodingRects(encoder, &encoder_tester, &decoder_tester, data, |
430 kTestRects + 3, 2); | 428 kTestRects + 3, 2); |
431 delete [] memory; | 429 delete [] memory; |
432 } | 430 } |
433 | 431 |
434 } // namespace remoting | 432 } // namespace remoting |
435 | 433 |
436 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::DecoderTester); | 434 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::DecoderTester); |
OLD | NEW |