| 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/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 VideoCaptureDeviceTest() | 119 VideoCaptureDeviceTest() |
| 120 : loop_(new base::MessageLoop()), | 120 : loop_(new base::MessageLoop()), |
| 121 client_( | 121 client_( |
| 122 new MockClient(base::Bind(&VideoCaptureDeviceTest::OnFrameCaptured, | 122 new MockClient(base::Bind(&VideoCaptureDeviceTest::OnFrameCaptured, |
| 123 base::Unretained(this)))), | 123 base::Unretained(this)))), |
| 124 video_capture_device_factory_(VideoCaptureDeviceFactory::CreateFactory( | 124 video_capture_device_factory_(VideoCaptureDeviceFactory::CreateFactory( |
| 125 base::MessageLoopProxy::current())) { | 125 base::MessageLoopProxy::current())) { |
| 126 device_enumeration_listener_ = new DeviceEnumerationListener(); | 126 device_enumeration_listener_ = new DeviceEnumerationListener(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 virtual void SetUp() { | 129 void SetUp() override { |
| 130 #if defined(OS_ANDROID) | 130 #if defined(OS_ANDROID) |
| 131 media::VideoCaptureDeviceAndroid::RegisterVideoCaptureDevice( | 131 media::VideoCaptureDeviceAndroid::RegisterVideoCaptureDevice( |
| 132 base::android::AttachCurrentThread()); | 132 base::android::AttachCurrentThread()); |
| 133 #endif | 133 #endif |
| 134 } | 134 } |
| 135 | 135 |
| 136 void ResetWithNewClient() { | 136 void ResetWithNewClient() { |
| 137 client_.reset(new MockClient(base::Bind( | 137 client_.reset(new MockClient(base::Bind( |
| 138 &VideoCaptureDeviceTest::OnFrameCaptured, base::Unretained(this)))); | 138 &VideoCaptureDeviceTest::OnFrameCaptured, base::Unretained(this)))); |
| 139 } | 139 } |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 // Use PIXEL_FORMAT_MAX to iterate all device names for testing | 429 // Use PIXEL_FORMAT_MAX to iterate all device names for testing |
| 430 // GetDeviceSupportedFormats(). | 430 // GetDeviceSupportedFormats(). |
| 431 scoped_ptr<VideoCaptureDevice::Name> name = | 431 scoped_ptr<VideoCaptureDevice::Name> name = |
| 432 GetFirstDeviceNameSupportingPixelFormat(PIXEL_FORMAT_MAX); | 432 GetFirstDeviceNameSupportingPixelFormat(PIXEL_FORMAT_MAX); |
| 433 // Verify no camera returned for PIXEL_FORMAT_MAX. Nothing else to test here | 433 // Verify no camera returned for PIXEL_FORMAT_MAX. Nothing else to test here |
| 434 // since we cannot forecast the hardware capabilities. | 434 // since we cannot forecast the hardware capabilities. |
| 435 ASSERT_FALSE(name); | 435 ASSERT_FALSE(name); |
| 436 } | 436 } |
| 437 | 437 |
| 438 }; // namespace media | 438 }; // namespace media |
| OLD | NEW |