| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "remoting/host/video_frame_recorder.h" | 5 #include "remoting/host/video_frame_recorder.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "remoting/codec/video_encoder_verbatim.h" | 10 #include "remoting/codec/video_encoder_verbatim.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 const int kFrameHeight = 480; | 45 const int kFrameHeight = 480; |
| 46 const size_t kTestFrameCount = 6; | 46 const size_t kTestFrameCount = 6; |
| 47 const int64 kTestFrameBytes = | 47 const int64 kTestFrameBytes = |
| 48 kFrameWidth * kFrameHeight * webrtc::DesktopFrame::kBytesPerPixel; | 48 kFrameWidth * kFrameHeight * webrtc::DesktopFrame::kBytesPerPixel; |
| 49 } // namespace | 49 } // namespace |
| 50 | 50 |
| 51 class VideoFrameRecorderTest : public testing::Test { | 51 class VideoFrameRecorderTest : public testing::Test { |
| 52 public: | 52 public: |
| 53 VideoFrameRecorderTest(); | 53 VideoFrameRecorderTest(); |
| 54 | 54 |
| 55 virtual void SetUp() override; | 55 void SetUp() override; |
| 56 virtual void TearDown() override; | 56 void TearDown() override; |
| 57 | 57 |
| 58 // Creates a new VideoEncoder, wraps it using |recorder_|, and stores the | 58 // Creates a new VideoEncoder, wraps it using |recorder_|, and stores the |
| 59 // newly wrapped encoder in |encoder_|. | 59 // newly wrapped encoder in |encoder_|. |
| 60 void CreateAndWrapEncoder(); | 60 void CreateAndWrapEncoder(); |
| 61 | 61 |
| 62 // Creates the next test frame to pass to |encoder_|. Each test frame's pixel | 62 // Creates the next test frame to pass to |encoder_|. Each test frame's pixel |
| 63 // values are set uniquely, so that tests can verify that the correct set of | 63 // values are set uniquely, so that tests can verify that the correct set of |
| 64 // frames were recorded. | 64 // frames were recorded. |
| 65 scoped_ptr<webrtc::DesktopFrame> CreateNextFrame(); | 65 scoped_ptr<webrtc::DesktopFrame> CreateNextFrame(); |
| 66 | 66 |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 EncodeTestFrames(); | 303 EncodeTestFrames(); |
| 304 | 304 |
| 305 // Clear the list of expected test frames, since none should be recorded. | 305 // Clear the list of expected test frames, since none should be recorded. |
| 306 STLDeleteElements(&test_frames_); | 306 STLDeleteElements(&test_frames_); |
| 307 | 307 |
| 308 // Verify that the recorded frames match the ones passed to the encoder. | 308 // Verify that the recorded frames match the ones passed to the encoder. |
| 309 VerifyTestFrames(); | 309 VerifyTestFrames(); |
| 310 } | 310 } |
| 311 | 311 |
| 312 } // namespace remoting | 312 } // namespace remoting |
| OLD | NEW |