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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 resolution.height(), | 263 resolution.height(), |
264 30, | 264 30, |
265 PIXEL_FORMAT_I420, | 265 PIXEL_FORMAT_I420, |
266 0, | 266 0, |
267 false, | 267 false, |
268 ConstantResolutionVideoCaptureDevice); | 268 ConstantResolutionVideoCaptureDevice); |
269 | 269 |
270 // The device (if it is an async implementation) may or may not get as far | 270 // The device (if it is an async implementation) may or may not get as far |
271 // as the OnFrameInfo() step; we're intentionally not going to wait for it | 271 // as the OnFrameInfo() step; we're intentionally not going to wait for it |
272 // to get that far. | 272 // to get that far. |
273 ON_CALL(*client, OnFrameInfo(_)); | 273 EXPECT_CALL(*client, OnFrameInfo(_)).Times(testing::AtMost(1)); |
274 device->AllocateAndStart(requested_format, | 274 device->AllocateAndStart(requested_format, |
275 client.PassAs<Client>()); | 275 client.PassAs<Client>()); |
276 device->StopAndDeAllocate(); | 276 device->StopAndDeAllocate(); |
277 } | 277 } |
278 | 278 |
279 // Finally, do a device start and wait for it to finish. | 279 // Finally, do a device start and wait for it to finish. |
280 gfx::Size resolution; | 280 gfx::Size resolution; |
281 VideoCaptureCapability requested_format( | 281 VideoCaptureCapability requested_format( |
282 320, | 282 320, |
283 240, | 283 240, |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 // FakeDevice is supposed to change and what is its actual frame rate. | 441 // 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 | 442 // We set TimeWait to 200 action timeouts and this should be enough for at |
443 // least action_count/kFakeCaptureCapabilityChangePeriod calls. | 443 // least action_count/kFakeCaptureCapabilityChangePeriod calls. |
444 for (int i = 0; i < action_count; ++i) { | 444 for (int i = 0; i < action_count; ++i) { |
445 WaitForCapturedFrame(); | 445 WaitForCapturedFrame(); |
446 } | 446 } |
447 device->StopAndDeAllocate(); | 447 device->StopAndDeAllocate(); |
448 } | 448 } |
449 | 449 |
450 }; // namespace media | 450 }; // namespace media |
OLD | NEW |