New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 626857 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

VideoCaptureDeviceTest are (mostly) disabled in Android

Project Member Reported by mcasas@chromium.org, Jul 9 2016

Issue description

VideoCaptureDeviceTest [1], confusingly enough, are meant
to use a device with a real camera. The test cases in 
the test, and their status for Android are:

- VideoCaptureDeviceTest_MAYBE_OpenInvalidDevice
 not disabled, but does relatively little.
- VideoCaptureDeviceTest_CaptureWithSize
 disabled for Android [2]
- VideoCaptureDeviceTest_MAYBE_AllocateBadSize
 disabled for Android [3]
- VideoCaptureDeviceTest_DISABLED_ReAllocateCamera
 hardcoded to disabled 
- VideoCaptureDeviceTest_DeAllocateCameraWhileRunning
 disabled for Android (twice!) [4]
- VideoCaptureDeviceTest_MAYBE_CaptureMjpeg
 disabled for Android [5]
- VideoCaptureDeviceTest_GetDeviceSupportedFormats
 not disabled (!) but it's doing very little.

There's a TODO [6] to enable them and a mysterious 
comment [7]:

// On Android, native camera (JAVA) delivers frames on UI thread which is the
// main thread for tests. This results in no frame received by
// VideoCaptureAndroid.

Consider seeing what's happening here and re-enable them.


[1] https://cs.chromium.org/chromium/src/media/capture/video/video_capture_device_unittest.cc?type=cs&q=video_capture_device_unittest&sq=package:chromium&l=156
[2] https://cs.chromium.org/chromium/src/media/capture/video/video_capture_device_unittest.cc?type=cs&q=video_capture_device_unittest&sq=package:chromium&l=338
[3] https://cs.chromium.org/chromium/src/media/capture/video/video_capture_device_unittest.cc?type=cs&q=video_capture_device_unittest&sq=package:chromium&l=56
[4] https://cs.chromium.org/chromium/src/media/capture/video/video_capture_device_unittest.cc?type=cs&q=video_capture_device_unittest&sq=package:chromium&l=57
[5] https://cs.chromium.org/chromium/src/media/capture/video/video_capture_device_unittest.cc?type=cs&q=video_capture_device_unittest&sq=package:chromium&l=59
[6] https://cs.chromium.org/chromium/src/media/capture/video/video_capture_device_unittest.cc?type=cs&q=video_capture_device_unittest&sq=package:chromium&l=52
[7] https://cs.chromium.org/chromium/src/media/capture/video/video_capture_device_unittest.cc?type=cs&q=video_capture_device_unittest&sq=package:chromium&l=53
 
Cc: tommi@chromium.org magjed@chromium.org
No cycles. Anyone from the Chrome STO team want to take a look at this?

Comment 2 by mcasas@chromium.org, Jul 20 2016

I tried running the MAYBE_TakePhoto and I could see that
the camera was correctly AllocateAndStart()ed, but it produced
no frames. Only complains on adb logcat was about no GL context.
the AndroidManifest.xml correctly included camera access.

jbudorick@ maybe we need to explicitly initialize EGL and/or
a GLSurface?
Owner: mcasas@chromium.org
Status: Started (was: Available)
https://codereview.chromium.org/2286303003/ has some first steps.
Project Member

Comment 4 by bugdroid1@chromium.org, Sep 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/da52a637d5ce09e9d0991b9d4d0238c195eb8ddc

commit da52a637d5ce09e9d0991b9d4d0238c195eb8ddc
Author: aelias <aelias@chromium.org>
Date: Thu Sep 08 01:28:10 2016

Revert of Video capture Android: enable unittests for Camera2 API (patchset #5 id:220001 of https://codereview.chromium.org/2286303003/ )

Reason for revert:
Caused WebViewLayoutTest#testMediaStreamApi and MediaAccessPermissionRequestTest#testGrantAccess to consistently fail.

Confirmed locally by reverting patch, commenting out @DisableIf and running:

ninja -C out/Release android_webview_test_apk android_webview_apk && out/Release/bin/run_android_webview_test_apk -f MediaAccessPermissionRequestTest.*

BUG= 644910 

Original issue's description:
> Video capture Android: enable unittests for Camera2 API
>
> This CL reenables a bunch of VideoCaptureDeviceTest
> test cases for Android and for the "new" APIs
>
> For this:
> - adds a |mTestMode| to VideoCapture.java, interface
>  of all camera java classes. VCCamera2.java tests this
>  flag and adds a capture thread if it's set.
> - the C++ correspondent classes get a method to configure
>  the java side for testing, and a method to test if the
>  underlying platform is using the new or the old APIs.
>
> Also:
> - Removes DeAllocateCameraWhileRunning because it was
>  equivalent to CaptureWithSize test case.
> - Cleans up/refactors some parts of the unit tests, adds
>  a few more comments etc
>
> BUG=626857
>
> Committed: https://crrev.com/7c32b70068c65b7bb372bb52a33d70b8e6653129
> Cr-Commit-Position: refs/heads/master@{#417015}

TBR=jbudorick@chromium.org,emircan@chromium.org,mcasas@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=626857

Review-Url: https://codereview.chromium.org/2320873002
Cr-Commit-Position: refs/heads/master@{#417147}

[modify] https://crrev.com/da52a637d5ce09e9d0991b9d4d0238c195eb8ddc/media/capture/video/android/java/src/org/chromium/media/VideoCapture.java
[modify] https://crrev.com/da52a637d5ce09e9d0991b9d4d0238c195eb8ddc/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java
[modify] https://crrev.com/da52a637d5ce09e9d0991b9d4d0238c195eb8ddc/media/capture/video/android/java/src/org/chromium/media/VideoCaptureFactory.java
[modify] https://crrev.com/da52a637d5ce09e9d0991b9d4d0238c195eb8ddc/media/capture/video/android/video_capture_device_android.cc
[modify] https://crrev.com/da52a637d5ce09e9d0991b9d4d0238c195eb8ddc/media/capture/video/android/video_capture_device_android.h
[modify] https://crrev.com/da52a637d5ce09e9d0991b9d4d0238c195eb8ddc/media/capture/video/android/video_capture_device_factory_android.cc
[modify] https://crrev.com/da52a637d5ce09e9d0991b9d4d0238c195eb8ddc/media/capture/video/android/video_capture_device_factory_android.h
[modify] https://crrev.com/da52a637d5ce09e9d0991b9d4d0238c195eb8ddc/media/capture/video/video_capture_device_unittest.cc

Project Member

Comment 5 by bugdroid1@chromium.org, Sep 8 2016

Labels: merge-merged-2854
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/da52a637d5ce09e9d0991b9d4d0238c195eb8ddc

commit da52a637d5ce09e9d0991b9d4d0238c195eb8ddc
Author: aelias <aelias@chromium.org>
Date: Thu Sep 08 01:28:10 2016

Revert of Video capture Android: enable unittests for Camera2 API (patchset #5 id:220001 of https://codereview.chromium.org/2286303003/ )

Reason for revert:
Caused WebViewLayoutTest#testMediaStreamApi and MediaAccessPermissionRequestTest#testGrantAccess to consistently fail.

Confirmed locally by reverting patch, commenting out @DisableIf and running:

ninja -C out/Release android_webview_test_apk android_webview_apk && out/Release/bin/run_android_webview_test_apk -f MediaAccessPermissionRequestTest.*

BUG= 644910 

Original issue's description:
> Video capture Android: enable unittests for Camera2 API
>
> This CL reenables a bunch of VideoCaptureDeviceTest
> test cases for Android and for the "new" APIs
>
> For this:
> - adds a |mTestMode| to VideoCapture.java, interface
>  of all camera java classes. VCCamera2.java tests this
>  flag and adds a capture thread if it's set.
> - the C++ correspondent classes get a method to configure
>  the java side for testing, and a method to test if the
>  underlying platform is using the new or the old APIs.
>
> Also:
> - Removes DeAllocateCameraWhileRunning because it was
>  equivalent to CaptureWithSize test case.
> - Cleans up/refactors some parts of the unit tests, adds
>  a few more comments etc
>
> BUG=626857
>
> Committed: https://crrev.com/7c32b70068c65b7bb372bb52a33d70b8e6653129
> Cr-Commit-Position: refs/heads/master@{#417015}

TBR=jbudorick@chromium.org,emircan@chromium.org,mcasas@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=626857

Review-Url: https://codereview.chromium.org/2320873002
Cr-Commit-Position: refs/heads/master@{#417147}

[modify] https://crrev.com/da52a637d5ce09e9d0991b9d4d0238c195eb8ddc/media/capture/video/android/java/src/org/chromium/media/VideoCapture.java
[modify] https://crrev.com/da52a637d5ce09e9d0991b9d4d0238c195eb8ddc/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java
[modify] https://crrev.com/da52a637d5ce09e9d0991b9d4d0238c195eb8ddc/media/capture/video/android/java/src/org/chromium/media/VideoCaptureFactory.java
[modify] https://crrev.com/da52a637d5ce09e9d0991b9d4d0238c195eb8ddc/media/capture/video/android/video_capture_device_android.cc
[modify] https://crrev.com/da52a637d5ce09e9d0991b9d4d0238c195eb8ddc/media/capture/video/android/video_capture_device_android.h
[modify] https://crrev.com/da52a637d5ce09e9d0991b9d4d0238c195eb8ddc/media/capture/video/android/video_capture_device_factory_android.cc
[modify] https://crrev.com/da52a637d5ce09e9d0991b9d4d0238c195eb8ddc/media/capture/video/android/video_capture_device_factory_android.h
[modify] https://crrev.com/da52a637d5ce09e9d0991b9d4d0238c195eb8ddc/media/capture/video/video_capture_device_unittest.cc

Project Member

Comment 6 by bugdroid1@chromium.org, Sep 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d6f5c9810a058d5c2a5db7589f39c54dad230f6a

commit d6f5c9810a058d5c2a5db7589f39c54dad230f6a
Author: mcasas <mcasas@chromium.org>
Date: Fri Sep 09 17:39:33 2016

Reland: Video capture Android: enable unittests for Camera2 API

[wip]
The original CL was reverted due to breaking, among others,
WebViewLayoutTest#testMediaStreamApi and
MediaAccessPermissionRequestTest#testGrantAccess

Original CL description ------------------------------------------------
Video capture Android: enable unittests for Camera2 API

This CL reenables a bunch of VideoCaptureDeviceTest
test cases for Android and for the "new" APIs

For this:
- adds a |mTestMode| to VideoCapture.java, interface
 of all camera java classes. VCCamera2.java tests this
 flag and adds a capture thread if it's set.
- the C++ correspondent classes get a method to configure
 the java side for testing, and a method to test if the
 underlying platform is using the new or the old APIs.

Also:
- Removes DeAllocateCameraWhileRunning because it was
 equivalent to CaptureWithSize test case.
- Cleans up/refactors some parts of the unit tests, adds
 a few more comments etc

BUG=626857

TBR=emircan@chromium.org, trivial change.
-------------------------------------------------------------------------

TEST= ninja -C out/Release android_webview_test_apk &&
out/Release/bin/run_android_webview_test_apk -f
MediaAccessPermissionRequestTest.*

fails in PS1, works in PS2

Review-Url: https://codereview.chromium.org/2324733004
Cr-Commit-Position: refs/heads/master@{#417619}

[modify] https://crrev.com/d6f5c9810a058d5c2a5db7589f39c54dad230f6a/media/capture/video/android/java/src/org/chromium/media/VideoCapture.java
[modify] https://crrev.com/d6f5c9810a058d5c2a5db7589f39c54dad230f6a/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java
[modify] https://crrev.com/d6f5c9810a058d5c2a5db7589f39c54dad230f6a/media/capture/video/android/java/src/org/chromium/media/VideoCaptureFactory.java
[modify] https://crrev.com/d6f5c9810a058d5c2a5db7589f39c54dad230f6a/media/capture/video/android/video_capture_device_android.cc
[modify] https://crrev.com/d6f5c9810a058d5c2a5db7589f39c54dad230f6a/media/capture/video/android/video_capture_device_android.h
[modify] https://crrev.com/d6f5c9810a058d5c2a5db7589f39c54dad230f6a/media/capture/video/android/video_capture_device_factory_android.cc
[modify] https://crrev.com/d6f5c9810a058d5c2a5db7589f39c54dad230f6a/media/capture/video/android/video_capture_device_factory_android.h
[modify] https://crrev.com/d6f5c9810a058d5c2a5db7589f39c54dad230f6a/media/capture/video/video_capture_device_unittest.cc

Project Member

Comment 7 by bugdroid1@chromium.org, Sep 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a8ae6bfb0e432ee220b641b0e8bb3f4800a7448a

commit a8ae6bfb0e432ee220b641b0e8bb3f4800a7448a
Author: mcasas <mcasas@chromium.org>
Date: Wed Sep 14 00:05:01 2016

ImageCapture: Connect takePhoto() VideoCaptureDeviceTest

This CL enables VideoCaptureDeviceTest.TakePhoto for
Android. (Note that, due to other circumstances, it'll
only be enabled for devices implementing the Camera2
API in non-legacy mode).

The only modification is that Android creates JPEGs
with APP1 JFIF header, because it includes EXIF information.

BUG= 518807 , 626857

Review-Url: https://codereview.chromium.org/2340573002
Cr-Commit-Position: refs/heads/master@{#418423}

[modify] https://crrev.com/a8ae6bfb0e432ee220b641b0e8bb3f4800a7448a/media/capture/video/video_capture_device_unittest.cc

Project Member

Comment 8 by bugdroid1@chromium.org, Sep 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2cedd2f7b2e116a977cb4812e2479733d295b96a

commit 2cedd2f7b2e116a977cb4812e2479733d295b96a
Author: aberent <aberent@chromium.org>
Date: Wed Sep 14 16:22:20 2016

Revert of ImageCapture: Connect takePhoto() VideoCaptureDeviceTest (patchset #1 id:1 of https://codereview.chromium.org/2340573002/ )

Reason for revert:
Fails on Android L.

BUG= 646840 

Original issue's description:
> ImageCapture: Connect takePhoto() VideoCaptureDeviceTest
>
> This CL enables VideoCaptureDeviceTest.TakePhoto for
> Android. (Note that, due to other circumstances, it'll
> only be enabled for devices implementing the Camera2
> API in non-legacy mode).
>
> The only modification is that Android creates JPEGs
> with APP1 JFIF header, because it includes EXIF information.
>
> BUG= 518807 , 626857
>
> Committed: https://crrev.com/a8ae6bfb0e432ee220b641b0e8bb3f4800a7448a
> Cr-Commit-Position: refs/heads/master@{#418423}

TBR=emircan@chromium.org,chfremer@chromium.org,mcasas@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 518807 , 626857

Review-Url: https://codereview.chromium.org/2344503003
Cr-Commit-Position: refs/heads/master@{#418580}

[modify] https://crrev.com/2cedd2f7b2e116a977cb4812e2479733d295b96a/media/capture/video/video_capture_device_unittest.cc

Project Member

Comment 9 by bugdroid1@chromium.org, Sep 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/de719226369c798fcb0a8afc0c02d3cf1c4c367e

commit de719226369c798fcb0a8afc0c02d3cf1c4c367e
Author: mcasas <mcasas@chromium.org>
Date: Thu Sep 15 23:48:43 2016

Reland: ImageCapture: Connect takePhoto() VideoCaptureDeviceTest

The original CL got reverted due to failing on a Lollipop bot. This
CL avoids Lollipops while investigations continue.

Original CL description ------------------------------------------------

This CL enables VideoCaptureDeviceTest.TakePhoto for
Android. (Note that, due to other circumstances, it'll
only be enabled for devices implementing the Camera2
API in non-legacy mode).

The only modification is that Android creates JPEGs
with APP1 JFIF header, because it includes EXIF information.

BUG= 518807 , 626857

TBR=emircan@chromium.org since the addec change is trivial.

Review-Url: https://codereview.chromium.org/2344683003
Cr-Commit-Position: refs/heads/master@{#419039}

[modify] https://crrev.com/de719226369c798fcb0a8afc0c02d3cf1c4c367e/media/capture/video/video_capture_device_unittest.cc

Comment 10 by hush@chromium.org, Sep 21 2016

Hello,
MediaAccessPermissionRequestTest#testGrantAccess still fails 
https://uberchromegw.corp.google.com/i/chromium.android/builders/Lollipop%20Tablet%20Tester/builds/4979

Comment 11 by hush@chromium.org, Sep 21 2016

I  488.453s run_tests_on_device(0a294402)    Error in testGrantAccess:
I  488.453s run_tests_on_device(0a294402)    java.util.concurrent.TimeoutException: waitForCallback timed out!
I  488.453s run_tests_on_device(0a294402)    	at org.chromium.content.browser.test.util.CallbackHelper.waitForCallback(CallbackHelper.java:184)
I  488.453s run_tests_on_device(0a294402)    	at org.chromium.content.browser.test.util.CallbackHelper.waitForCallback(CallbackHelper.java:192)
I  488.453s run_tests_on_device(0a294402)    	at org.chromium.content.browser.test.util.CallbackHelper.waitForCallback(CallbackHelper.java:198)
I  488.454s run_tests_on_device(0a294402)    	at org.chromium.android_webview.test.MediaAccessPermissionRequestTest.testGrantAccess(MediaAccessPermissionRequestTest.java:95)
I  488.454s run_tests_on_device(0a294402)    	at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
I  488.454s run_tests_on_device(0a294402)    	at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
I  488.454s run_tests_on_device(0a294402)    	at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192)
I  488.454s run_tests_on_device(0a294402)    	at org.chromium.base.test.BaseTestResult.runParameterized(BaseTestResult.java:161)
I  488.454s run_tests_on_device(0a294402)    	at org.chromium.base.test.BaseTestResult.run(BaseTestResult.java:124)
I  488.454s run_tests_on_device(0a294402)    	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
I  488.454s run_tests_on_device(0a294402)    	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
I  488.454s run_tests_on_device(0a294402)    	at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
I  488.454s run_tests_on_device(0a294402)    	at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1853)

Owner: ----
Status: Available (was: Started)
I'm afraid I won't have time to work on this any time soon,
rolling it back to available.
Project Member

Comment 13 by sheriffbot@chromium.org, Apr 25 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)
Still available and needs addressing.

Sign in to add a comment