| 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 <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
| 7 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 8 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
| 9 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 10 #include "remoting/codec/video_encoder_verbatim.h" | 14 #include "remoting/codec/video_encoder_verbatim.h" |
| 11 #include "remoting/proto/video.pb.h" | 15 #include "remoting/proto/video.pb.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" | 17 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" |
| 14 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | 18 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
| 15 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h" | 19 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h" |
| 16 | 20 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 37 } | 41 } |
| 38 | 42 |
| 39 } // namespace | 43 } // namespace |
| 40 | 44 |
| 41 namespace remoting { | 45 namespace remoting { |
| 42 | 46 |
| 43 namespace { | 47 namespace { |
| 44 const int kFrameWidth = 640; | 48 const int kFrameWidth = 640; |
| 45 const int kFrameHeight = 480; | 49 const int kFrameHeight = 480; |
| 46 const size_t kTestFrameCount = 6; | 50 const size_t kTestFrameCount = 6; |
| 47 const int64 kTestFrameBytes = | 51 const int64_t kTestFrameBytes = |
| 48 kFrameWidth * kFrameHeight * webrtc::DesktopFrame::kBytesPerPixel; | 52 kFrameWidth * kFrameHeight * webrtc::DesktopFrame::kBytesPerPixel; |
| 49 } // namespace | 53 } // namespace |
| 50 | 54 |
| 51 class VideoFrameRecorderTest : public testing::Test { | 55 class VideoFrameRecorderTest : public testing::Test { |
| 52 public: | 56 public: |
| 53 VideoFrameRecorderTest(); | 57 VideoFrameRecorderTest(); |
| 54 | 58 |
| 55 void SetUp() override; | 59 void SetUp() override; |
| 56 void TearDown() override; | 60 void TearDown() override; |
| 57 | 61 |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 EncodeTestFrames(); | 309 EncodeTestFrames(); |
| 306 | 310 |
| 307 // Clear the list of expected test frames, since none should be recorded. | 311 // Clear the list of expected test frames, since none should be recorded. |
| 308 STLDeleteElements(&test_frames_); | 312 STLDeleteElements(&test_frames_); |
| 309 | 313 |
| 310 // Verify that the recorded frames match the ones passed to the encoder. | 314 // Verify that the recorded frames match the ones passed to the encoder. |
| 311 VerifyTestFrames(); | 315 VerifyTestFrames(); |
| 312 } | 316 } |
| 313 | 317 |
| 314 } // namespace remoting | 318 } // namespace remoting |
| OLD | NEW |