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

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

Issue 2344683003: Reland: ImageCapture: Connect takePhoto() VideoCaptureDeviceTest (Closed)
Patch Set: Don't run VideoCaptureDeviceTest.TakePhoto in Lollipop devices or earlier Created 4 years, 3 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 | « no previous file | 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 f752360a1c34c96c012bac03492825fef38318de..ac61a4c50bc36e12061c4d61a5216848591252c8 100644
--- a/media/capture/video/video_capture_device_unittest.cc
+++ b/media/capture/video/video_capture_device_unittest.cc
@@ -38,6 +38,7 @@
#if defined(OS_ANDROID)
#include "base/android/jni_android.h"
+#include "base/android/build_info.h"
#include "media/capture/video/android/video_capture_device_android.h"
#include "media/capture/video/android/video_capture_device_factory_android.h"
#endif
@@ -55,7 +56,7 @@
#elif defined(OS_ANDROID)
#define MAYBE_AllocateBadSize AllocateBadSize
#define MAYBE_CaptureMjpeg CaptureMjpeg
-#define MAYBE_TakePhoto DISABLED_TakePhoto
+#define MAYBE_TakePhoto TakePhoto
#elif defined(OS_LINUX)
// AllocateBadSize will hang when a real camera is attached and if more than one
// test is trying to use the camera (even across processes). Do NOT renable
@@ -148,7 +149,7 @@ class MockImageCaptureClient : public base::RefCounted<MockImageCaptureClient> {
EXPECT_EQ(0xFF, blob->data[0]); // First SOI byte
EXPECT_EQ(0xD8, blob->data[1]); // Second SOI byte
EXPECT_EQ(0xFF, blob->data[2]); // First JFIF-APP0 byte
- EXPECT_EQ(0xE0, blob->data[3]); // Second JFIF-APP0 byte
+ EXPECT_EQ(0xE0, blob->data[3] & 0xF0); // Second JFIF-APP0/APP1 byte
OnCorrectPhotoTaken();
}
MOCK_METHOD0(OnCorrectPhotoTaken, void(void));
@@ -509,6 +510,14 @@ TEST_F(VideoCaptureDeviceTest, MAYBE_TakePhoto) {
if (!EnumerateAndFindUsableDevices())
return;
+#if defined(OS_ANDROID)
+ // TODO(mcasas): fails on Lollipop devices, reconnect https://crbug.com/646840
+ if (base::android::BuildInfo::GetInstance()->sdk_int() <
+ base::android::SDK_VERSION_MARSHMALLOW) {
+ return;
+ }
+#endif
+
std::unique_ptr<VideoCaptureDevice> device(
video_capture_device_factory_->CreateDevice(
device_descriptors_->front()));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698