| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 using ::testing::_; | 57 using ::testing::_; |
| 58 using ::testing::AnyNumber; | 58 using ::testing::AnyNumber; |
| 59 using ::testing::Return; | 59 using ::testing::Return; |
| 60 using ::testing::AtLeast; | 60 using ::testing::AtLeast; |
| 61 using ::testing::SaveArg; | 61 using ::testing::SaveArg; |
| 62 | 62 |
| 63 namespace media { | 63 namespace media { |
| 64 | 64 |
| 65 class MockClient : public media::VideoCaptureDevice::Client { | 65 class MockClient : public media::VideoCaptureDevice::Client { |
| 66 public: | 66 public: |
| 67 MOCK_METHOD0(ReserveOutputBuffer, scoped_refptr<media::VideoFrame>()); | 67 MOCK_METHOD1(ReserveOutputBuffer, |
| 68 scoped_refptr<media::VideoFrame>(const gfx::Size&)); |
| 68 MOCK_METHOD0(OnErr, void()); | 69 MOCK_METHOD0(OnErr, void()); |
| 69 MOCK_METHOD1(OnFrameInfo, void(const VideoCaptureCapability&)); | 70 MOCK_METHOD1(OnFrameInfo, void(const VideoCaptureCapability&)); |
| 70 MOCK_METHOD1(OnFrameInfoChanged, void(const VideoCaptureCapability&)); | 71 MOCK_METHOD1(OnFrameInfoChanged, void(const VideoCaptureCapability&)); |
| 71 | 72 |
| 72 explicit MockClient( | 73 explicit MockClient( |
| 73 base::Closure frame_cb) | 74 base::Closure frame_cb) |
| 74 : main_thread_(base::MessageLoopProxy::current()), | 75 : main_thread_(base::MessageLoopProxy::current()), |
| 75 frame_cb_(frame_cb) {} | 76 frame_cb_(frame_cb) {} |
| 76 | 77 |
| 77 virtual void OnError() OVERRIDE { | 78 virtual void OnError() OVERRIDE { |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 &capture_formats); | 477 &capture_formats); |
| 477 EXPECT_GE(capture_formats.size(), 1u); | 478 EXPECT_GE(capture_formats.size(), 1u); |
| 478 EXPECT_EQ(capture_formats[0].width, 640); | 479 EXPECT_EQ(capture_formats[0].width, 640); |
| 479 EXPECT_EQ(capture_formats[0].height, 480); | 480 EXPECT_EQ(capture_formats[0].height, 480); |
| 480 EXPECT_EQ(capture_formats[0].color, media::PIXEL_FORMAT_I420); | 481 EXPECT_EQ(capture_formats[0].color, media::PIXEL_FORMAT_I420); |
| 481 EXPECT_GE(capture_formats[0].frame_rate, 20); | 482 EXPECT_GE(capture_formats[0].frame_rate, 20); |
| 482 } | 483 } |
| 483 } | 484 } |
| 484 | 485 |
| 485 }; // namespace media | 486 }; // namespace media |
| OLD | NEW |