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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 // FakeDevice is supposed to change and what is its actual frame rate. | 442 // FakeDevice is supposed to change and what is its actual frame rate. |
442 // We set TimeWait to 200 action timeouts and this should be enough for at | 443 // We set TimeWait to 200 action timeouts and this should be enough for at |
443 // least action_count/kFakeCaptureCapabilityChangePeriod calls. | 444 // least action_count/kFakeCaptureCapabilityChangePeriod calls. |
444 for (int i = 0; i < action_count; ++i) { | 445 for (int i = 0; i < action_count; ++i) { |
445 WaitForCapturedFrame(); | 446 WaitForCapturedFrame(); |
446 } | 447 } |
447 device->StopAndDeAllocate(); | 448 device->StopAndDeAllocate(); |
448 } | 449 } |
449 | 450 |
450 }; // namespace media | 451 }; // namespace media |
OLD | NEW |