Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(713)

Unified Diff: media/capture/video/video_capture_device_unittest.cc

Issue 2837273004: media: add video capture device for ARC++ camera HAL v3 (Closed)
Patch Set: RELAND: media: add video capture device for ARC++ camera HAL v3 Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/capture/video/linux/video_capture_device_factory_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/video/video_capture_device_unittest.cc
diff --git a/media/capture/video/video_capture_device_unittest.cc b/media/capture/video/video_capture_device_unittest.cc
index 7cd1d31fb30cddc189812dea45340d52ef3ce254..3c4f1f2ed116b57e29050f5cfbcecd2faa182a4e 100644
--- a/media/capture/video/video_capture_device_unittest.cc
+++ b/media/capture/video/video_capture_device_unittest.cc
@@ -43,6 +43,13 @@
#include "media/capture/video/android/video_capture_device_factory_android.h"
#endif
+#if defined(OS_CHROMEOS)
+#include "media/capture/video/chromeos/video_capture_device_arc_chromeos.h"
+#include "media/capture/video/chromeos/video_capture_device_factory_chromeos.h"
+#include "mojo/edk/embedder/embedder.h"
+#include "mojo/edk/embedder/scoped_ipc_support.h"
+#endif
+
#if defined(OS_MACOSX)
// Mac will always give you the size you ask for and this case will fail.
#define MAYBE_AllocateBadSize DISABLED_AllocateBadSize
@@ -205,6 +212,39 @@ class MockImageCaptureClient
mojom::PhotoStatePtr state_;
};
+#if defined(OS_CHROMEOS)
+
+class MojoEnabledTestEnvironment final : public testing::Environment {
+ public:
+ MojoEnabledTestEnvironment() : mojo_ipc_thread_("MojoIpcThread") {}
+
+ ~MojoEnabledTestEnvironment() final {}
+
+ void SetUp() final {
+ mojo::edk::Init();
+ mojo_ipc_thread_.StartWithOptions(
+ base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
+ mojo_ipc_support_.reset(new mojo::edk::ScopedIPCSupport(
+ mojo_ipc_thread_.task_runner(),
+ mojo::edk::ScopedIPCSupport::ShutdownPolicy::FAST));
+ VLOG(1) << "Mojo initialized";
+ }
+
+ void TearDown() final {
+ mojo_ipc_support_.reset();
+ VLOG(1) << "Mojo IPC tear down";
+ }
+
+ private:
+ base::Thread mojo_ipc_thread_;
+ std::unique_ptr<mojo::edk::ScopedIPCSupport> mojo_ipc_support_;
+};
+
+testing::Environment* const mojo_test_env =
+ testing::AddGlobalTestEnvironment(new MojoEnabledTestEnvironment());
+
+#endif
+
} // namespace
class VideoCaptureDeviceTest : public testing::TestWithParam<gfx::Size> {
@@ -527,6 +567,13 @@ TEST_F(VideoCaptureDeviceTest, MAYBE_TakePhoto) {
if (!FindUsableDevices())
return;
+#if defined(OS_CHROMEOS)
+ // TODO(jcliang): Remove this after we implement TakePhoto.
+ if (VideoCaptureDeviceFactoryChromeOS::ShouldEnable()) {
+ return;
+ }
+#endif
+
#if defined(OS_ANDROID)
// TODO(mcasas): fails on Lollipop devices, reconnect https://crbug.com/646840
if (base::android::BuildInfo::GetInstance()->sdk_int() <
@@ -572,6 +619,13 @@ TEST_F(VideoCaptureDeviceTest, MAYBE_GetPhotoState) {
if (!FindUsableDevices())
return;
+#if defined(OS_CHROMEOS)
+ // TODO(jcliang): Remove this after we implement GetPhotoCapabilities.
+ if (VideoCaptureDeviceFactoryChromeOS::ShouldEnable()) {
+ return;
+ }
+#endif
+
#if defined(OS_ANDROID)
// TODO(mcasas): fails on Lollipop devices, reconnect https://crbug.com/646840
if (base::android::BuildInfo::GetInstance()->sdk_int() <
« no previous file with comments | « media/capture/video/linux/video_capture_device_factory_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698