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

Side by Side Diff: media/video/capture/fake_video_capture_device_unittest.cc

Issue 1106563002: FakeVideoCaptureDevice: add support for capturing into Dma-Bufs using VGEM in CrOs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
OLDNEW
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/test/test_timeouts.h" 8 #include "base/test/test_timeouts.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "media/base/video_capture_types.h" 10 #include "media/base/video_capture_types.h"
(...skipping 21 matching lines...) Expand all
32 // This class is a Client::Buffer that allocates and frees the requested |size|. 32 // This class is a Client::Buffer that allocates and frees the requested |size|.
33 class MockBuffer : public VideoCaptureDevice::Client::Buffer { 33 class MockBuffer : public VideoCaptureDevice::Client::Buffer {
34 public: 34 public:
35 MockBuffer(int buffer_id, size_t size) 35 MockBuffer(int buffer_id, size_t size)
36 : id_(buffer_id), size_(size), data_(new uint8[size_]) {} 36 : id_(buffer_id), size_(size), data_(new uint8[size_]) {}
37 ~MockBuffer() override { delete[] data_; } 37 ~MockBuffer() override { delete[] data_; }
38 int id() const override { return id_; } 38 int id() const override { return id_; }
39 size_t size() const override { return size_; } 39 size_t size() const override { return size_; }
40 void* data() override { return data_; } 40 void* data() override { return data_; }
41 ClientBuffer AsClientBuffer() override { return nullptr; } 41 ClientBuffer AsClientBuffer() override { return nullptr; }
42 base::PlatformFile AsPlatformFile() override { return 0; }
42 43
43 private: 44 private:
44 const int id_; 45 const int id_;
45 const size_t size_; 46 const size_t size_;
46 uint8* const data_; 47 uint8* const data_;
47 }; 48 };
48 49
49 class MockClient : public VideoCaptureDevice::Client { 50 class MockClient : public VideoCaptureDevice::Client {
50 public: 51 public:
51 MOCK_METHOD1(OnError, void(const std::string& reason)); 52 MOCK_METHOD1(OnError, void(const std::string& reason));
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 EXPECT_EQ(supported_formats[2].pixel_format, PIXEL_FORMAT_I420); 215 EXPECT_EQ(supported_formats[2].pixel_format, PIXEL_FORMAT_I420);
215 EXPECT_GE(supported_formats[2].frame_rate, 20.0); 216 EXPECT_GE(supported_formats[2].frame_rate, 20.0);
216 EXPECT_EQ(supported_formats[3].frame_size.width(), 1920); 217 EXPECT_EQ(supported_formats[3].frame_size.width(), 1920);
217 EXPECT_EQ(supported_formats[3].frame_size.height(), 1080); 218 EXPECT_EQ(supported_formats[3].frame_size.height(), 1080);
218 EXPECT_EQ(supported_formats[3].pixel_format, PIXEL_FORMAT_I420); 219 EXPECT_EQ(supported_formats[3].pixel_format, PIXEL_FORMAT_I420);
219 EXPECT_GE(supported_formats[3].frame_rate, 20.0); 220 EXPECT_GE(supported_formats[3].frame_rate, 20.0);
220 } 221 }
221 } 222 }
222 223
223 }; // namespace media 224 }; // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698