| 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 25 matching lines...) Expand all Loading... |
| 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 | 38 |
| 39 int id() const override { return id_; } | 39 int id() const override { return id_; } |
| 40 size_t size() const override { return size_; } | 40 size_t size() const override { return size_; } |
| 41 void* data() override { return data_; } | 41 void* data() override { return data_; } |
| 42 gfx::GpuMemoryBufferType GetType() override { | 42 gfx::GpuMemoryBufferType GetType() override { |
| 43 return gfx::SHARED_MEMORY_BUFFER; | 43 return gfx::SHARED_MEMORY_BUFFER; |
| 44 } | 44 } |
| 45 ClientBuffer AsClientBuffer() override { return nullptr; } | 45 ClientBuffer AsClientBuffer() override { return nullptr; } |
| 46 base::PlatformFile AsPlatformFile() override { return 0; } |
| 46 | 47 |
| 47 private: | 48 private: |
| 48 const int id_; | 49 const int id_; |
| 49 const size_t size_; | 50 const size_t size_; |
| 50 uint8* const data_; | 51 uint8* const data_; |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 class MockClient : public VideoCaptureDevice::Client { | 54 class MockClient : public VideoCaptureDevice::Client { |
| 54 public: | 55 public: |
| 55 MOCK_METHOD1(OnError, void(const std::string& reason)); | 56 MOCK_METHOD1(OnError, void(const std::string& reason)); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 EXPECT_EQ(supported_formats[2].pixel_format, PIXEL_FORMAT_I420); | 219 EXPECT_EQ(supported_formats[2].pixel_format, PIXEL_FORMAT_I420); |
| 219 EXPECT_GE(supported_formats[2].frame_rate, 20.0); | 220 EXPECT_GE(supported_formats[2].frame_rate, 20.0); |
| 220 EXPECT_EQ(supported_formats[3].frame_size.width(), 1920); | 221 EXPECT_EQ(supported_formats[3].frame_size.width(), 1920); |
| 221 EXPECT_EQ(supported_formats[3].frame_size.height(), 1080); | 222 EXPECT_EQ(supported_formats[3].frame_size.height(), 1080); |
| 222 EXPECT_EQ(supported_formats[3].pixel_format, PIXEL_FORMAT_I420); | 223 EXPECT_EQ(supported_formats[3].pixel_format, PIXEL_FORMAT_I420); |
| 223 EXPECT_GE(supported_formats[3].frame_rate, 20.0); | 224 EXPECT_GE(supported_formats[3].frame_rate, 20.0); |
| 224 } | 225 } |
| 225 } | 226 } |
| 226 | 227 |
| 227 }; // namespace media | 228 }; // namespace media |
| OLD | NEW |