Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Side by Side Diff: media/video/capture/screen/screen_capture_device_unittest.cc

Issue 12090109: Tab Capture: Backing store readbacks to YV12 VideoFrames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style fix per wjia Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "media/video/capture/screen/screen_capture_device.h" 5 #include "media/video/capture/screen/screen_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 19 matching lines...) Expand all
30 const int kBufferSize = kTestFrameWidth2 * kTestFrameHeight2 * 4; 30 const int kBufferSize = kTestFrameWidth2 * kTestFrameHeight2 * 4;
31 31
32 const int kFrameRate = 30; 32 const int kFrameRate = 30;
33 33
34 class MockFrameObserver : public VideoCaptureDevice::EventHandler { 34 class MockFrameObserver : public VideoCaptureDevice::EventHandler {
35 public: 35 public:
36 MOCK_METHOD0(OnError, void()); 36 MOCK_METHOD0(OnError, void());
37 MOCK_METHOD1(OnFrameInfo, void(const VideoCaptureCapability& info)); 37 MOCK_METHOD1(OnFrameInfo, void(const VideoCaptureCapability& info));
38 MOCK_METHOD3(OnIncomingCapturedFrame, void(const uint8* data, int length, 38 MOCK_METHOD3(OnIncomingCapturedFrame, void(const uint8* data, int length,
39 base::Time timestamp)); 39 base::Time timestamp));
40 MOCK_METHOD2(OnIncomingCapturedVideoFrame, void(media::VideoFrame* frame,
41 base::Time timestamp));
40 }; 42 };
41 43
42 // TODO(sergeyu): Move this to a separate file where it can be reused. 44 // TODO(sergeyu): Move this to a separate file where it can be reused.
43 class FakeScreenCapturer : public ScreenCapturer { 45 class FakeScreenCapturer : public ScreenCapturer {
44 public: 46 public:
45 FakeScreenCapturer() 47 FakeScreenCapturer()
46 : delegate_(NULL), 48 : delegate_(NULL),
47 frame_index_(0) { 49 frame_index_(0) {
48 buffer_.reset(new uint8[kBufferSize]); 50 buffer_.reset(new uint8[kBufferSize]);
49 frames_[0] = new ScreenCaptureData( 51 frames_[0] = new ScreenCaptureData(
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 EXPECT_EQ(kTestFrameWidth1, caps.width); 161 EXPECT_EQ(kTestFrameWidth1, caps.width);
160 EXPECT_EQ(kTestFrameHeight1, caps.height); 162 EXPECT_EQ(kTestFrameHeight1, caps.height);
161 EXPECT_EQ(kFrameRate, caps.frame_rate); 163 EXPECT_EQ(kFrameRate, caps.frame_rate);
162 EXPECT_EQ(VideoCaptureCapability::kARGB, caps.color); 164 EXPECT_EQ(VideoCaptureCapability::kARGB, caps.color);
163 EXPECT_FALSE(caps.interlaced); 165 EXPECT_FALSE(caps.interlaced);
164 166
165 EXPECT_EQ(caps.width * caps.height * 4, frame_size); 167 EXPECT_EQ(caps.width * caps.height * 4, frame_size);
166 } 168 }
167 169
168 } // namespace media 170 } // namespace media
OLDNEW
« no previous file with comments | « media/video/capture/mac/video_capture_device_qtkit_mac.mm ('k') | media/video/capture/video_capture_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698