No camera on trybot android-kitkat-arm-rel? |
||||
Issue descriptionThere are unit tests running in the commit queue as part of capture_unittests and content_browsertests that check for a physical camera and skip the test if they don't find one. On android-marshmallow-arm-rel a camera is found and the tests run and pass. On android-kitkat-arm-rel however, no camera is found and the tests are skipped. This seems unexpected. Since this is arm, I am assuming the tests are run on an actual device (not an emulator) and I am not aware of any device without a camera.
,
Jul 12
interesting. android-kitkat-arm-rel uses N5s, which do have cameras...
,
Jul 12
I worry about tests using the cameras. Are they taking pictures? I hope they're not using the flash... Can you give an example of a test that only runs if a camera is detected?
,
Jul 12
Sure. First, an example for the log output that seems to indicate that no camera was found: Search for "No usable camera found" in https://logs.chromium.org/v/?s=chromium%2Fbuildbucket%2Fcr-buildbucket.appspot.com%2F8941258828332355696%2F%2B%2Fsteps%2Fcapture_unittests_on_Android_device_Nexus_5__with_patch_%2F0%2Fstdout The same test on the marshmallow trybot produces "Using camera camera2 1, facing front", see in https://logs.chromium.org/v/?s=chromium%2Fbuildbucket%2Fcr-buildbucket.appspot.com%2F8941362017300580624%2F%2B%2Fsteps%2Fcapture_unittests_on_Android_device_Nexus_5X__with_patch_%2F0%2Fstdout The source for the test that produces these logs is located here: https://cs.chromium.org/chromium/src/media/capture/video/video_capture_device_unittest.cc?q=video_capture_device_unittest&dr&l=349 The above test just tries to open the camera for video capture. But this is not the only test that tries to use a physical camera. There is a set of tests in content_browsertests that test taking still images via a Web API. I don't think the tests actively try to use the flash, though, but that may or may not become a future test case. I found that unless content_browsertests are also run post-commit on other Android devices, the trybots are the only place where certain Android specific camera code (part of Chromium) gets exercised. If the trybots are not the right place to run this, is there some other place where we can move them to that can trigger build failures if they break?
,
Jul 12
I wonder if we need to grant the test runner package the android.permission.CAMERA permission. Might be an OS level thing, since we're doing that on the M bot and not the K bot. I can look into in a bit (unless someone else wants to)
,
Jul 13
Did a little digging. Turns out it is an OS level thing, but not related to permissions (at least not directly). When running on an N5 on K (like the trybot in question), the test sees both front and back cameras. But neither pass this check: https://codesearch.chromium.org/chromium/src/media/capture/video/video_capture_device_unittest.cc?rcl=2320c23b12b31ac25eed8da3223f53284e1e06d4&l=359 And that check is implemented at: https://codesearch.chromium.org/chromium/src/media/capture/video/android/java/src/org/chromium/media/VideoCaptureFactory.java?rcl=5aa63e066731a6df12bf27d727fd912cdfd083cf&l=65 The test considers any camera on a pre-L device to be "legacy/deprecated", and so ignores it. I'm not sure why it does that. (I forced that condition to return true regardless, reran the test, and it ended up hanging indefinitely. So presumably it's there for a good reason.) This is likely out of scope for infra, so passing the bug over. Feel free to pass it back if there's something we can do.
,
Jul 13
errr... s/return true/return false/
,
Jul 13
bpastene@: Thanks so much for digging into this. I should have known about this check, since it is in the Chromium code, and I should also be able to fix it. Sorry to have bothered you with this, since it is not an infra issue after all. |
||||
►
Sign in to add a comment |
||||
Comment 1 by martiniss@chromium.org
, Jul 11Components: -Infra Infra>Client>Chrome