OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/browser/renderer_host/media/desktop_capture_device.h" | 5 #include "content/browser/renderer_host/media/desktop_capture_device.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/sequenced_task_runner.h" | 8 #include "base/sequenced_task_runner.h" |
9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 const int kTestFrameWidth1 = 100; | 34 const int kTestFrameWidth1 = 100; |
35 const int kTestFrameHeight1 = 100; | 35 const int kTestFrameHeight1 = 100; |
36 const int kTestFrameWidth2 = 200; | 36 const int kTestFrameWidth2 = 200; |
37 const int kTestFrameHeight2 = 150; | 37 const int kTestFrameHeight2 = 150; |
38 | 38 |
39 const int kFrameRate = 30; | 39 const int kFrameRate = 30; |
40 | 40 |
41 class MockDeviceClient : public media::VideoCaptureDevice::Client { | 41 class MockDeviceClient : public media::VideoCaptureDevice::Client { |
42 public: | 42 public: |
43 MOCK_METHOD0(ReserveOutputBuffer, scoped_refptr<media::VideoFrame>()); | 43 MOCK_METHOD1(ReserveOutputBuffer, |
| 44 scoped_refptr<media::VideoFrame>(const gfx::Size& size)); |
44 MOCK_METHOD0(OnError, void()); | 45 MOCK_METHOD0(OnError, void()); |
45 MOCK_METHOD1(OnFrameInfo, void(const media::VideoCaptureCapability& info)); | 46 MOCK_METHOD1(OnFrameInfo, void(const media::VideoCaptureCapability& info)); |
46 MOCK_METHOD1(OnFrameInfoChanged, | 47 MOCK_METHOD1(OnFrameInfoChanged, |
47 void(const media::VideoCaptureCapability& info)); | 48 void(const media::VideoCaptureCapability& info)); |
48 MOCK_METHOD6(OnIncomingCapturedFrame, void(const uint8* data, | 49 MOCK_METHOD6(OnIncomingCapturedFrame, void(const uint8* data, |
49 int length, | 50 int length, |
50 base::Time timestamp, | 51 base::Time timestamp, |
51 int rotation, | 52 int rotation, |
52 bool flip_vert, | 53 bool flip_vert, |
53 bool flip_horiz)); | 54 bool flip_horiz)); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 | 256 |
256 EXPECT_EQ(kTestFrameWidth1, caps.width); | 257 EXPECT_EQ(kTestFrameWidth1, caps.width); |
257 EXPECT_EQ(kTestFrameHeight1, caps.height); | 258 EXPECT_EQ(kTestFrameHeight1, caps.height); |
258 EXPECT_EQ(kFrameRate, caps.frame_rate); | 259 EXPECT_EQ(kFrameRate, caps.frame_rate); |
259 EXPECT_EQ(media::PIXEL_FORMAT_ARGB, caps.color); | 260 EXPECT_EQ(media::PIXEL_FORMAT_ARGB, caps.color); |
260 EXPECT_FALSE(caps.interlaced); | 261 EXPECT_FALSE(caps.interlaced); |
261 worker_pool_->FlushForTesting(); | 262 worker_pool_->FlushForTesting(); |
262 } | 263 } |
263 | 264 |
264 } // namespace content | 265 } // namespace content |
OLD | NEW |