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 <deque> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 | 7 |
8 #include "gfx/rect.h" | 8 #include "gfx/rect.h" |
9 #include "media/base/video_frame.h" | 9 #include "media/base/video_frame.h" |
10 #include "remoting/base/codec_test.h" | 10 #include "remoting/base/codec_test.h" |
| 11 #include "remoting/base/decoder.h" |
11 #include "remoting/base/encoder.h" | 12 #include "remoting/base/encoder.h" |
12 #include "remoting/base/mock_objects.h" | 13 #include "remoting/base/mock_objects.h" |
13 #include "remoting/base/protocol_util.h" | 14 #include "remoting/base/protocol_util.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
15 | 16 |
16 static const int kWidth = 320; | 17 static const int kWidth = 320; |
17 static const int kHeight = 240; | 18 static const int kHeight = 240; |
18 static const int kBytesPerPixel = 4; | 19 static const int kBytesPerPixel = 4; |
19 | 20 |
20 // Some sample rects for testing. | 21 // Some sample rects for testing. |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 std::deque<gfx::Rect> rects_; | 246 std::deque<gfx::Rect> rects_; |
246 UpdatedRects update_rects_; | 247 UpdatedRects update_rects_; |
247 Decoder* decoder_; | 248 Decoder* decoder_; |
248 scoped_refptr<media::VideoFrame> frame_; | 249 scoped_refptr<media::VideoFrame> frame_; |
249 scoped_refptr<CaptureData> capture_data_; | 250 scoped_refptr<CaptureData> capture_data_; |
250 bool decode_done_; | 251 bool decode_done_; |
251 | 252 |
252 DISALLOW_COPY_AND_ASSIGN(DecoderTester); | 253 DISALLOW_COPY_AND_ASSIGN(DecoderTester); |
253 }; | 254 }; |
254 | 255 |
| 256 // The EncoderTester provides a hook for retrieving the data, and passing the |
| 257 // message to other subprograms for validaton. |
255 class EncoderTester { | 258 class EncoderTester { |
256 public: | 259 public: |
257 EncoderTester(EncoderMessageTester* message_tester, | 260 EncoderTester(EncoderMessageTester* message_tester, |
258 EncoderStateTester* state_tester) | 261 EncoderStateTester* state_tester) |
259 : message_tester_(message_tester), | 262 : message_tester_(message_tester), |
260 state_tester_(state_tester), | 263 state_tester_(state_tester), |
261 decoder_tester_(NULL), | 264 decoder_tester_(NULL), |
262 data_available_(0) { | 265 data_available_(0) { |
263 } | 266 } |
264 | 267 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 TestEncodingRects(encoder, &encoder_tester, &decoder_tester, data, | 425 TestEncodingRects(encoder, &encoder_tester, &decoder_tester, data, |
423 kTestRects + 2, 1); | 426 kTestRects + 2, 1); |
424 TestEncodingRects(encoder, &encoder_tester, &decoder_tester, data, | 427 TestEncodingRects(encoder, &encoder_tester, &decoder_tester, data, |
425 kTestRects + 3, 2); | 428 kTestRects + 3, 2); |
426 delete [] memory; | 429 delete [] memory; |
427 } | 430 } |
428 | 431 |
429 } // namespace remoting | 432 } // namespace remoting |
430 | 433 |
431 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::DecoderTester); | 434 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::DecoderTester); |
OLD | NEW |