| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |