Wed, 31 Dec 2014 07:22:50 +0100
Correct previous dual key logic pending first delivery installment.
michael@0 | 1 | package org.mozilla.gecko.tests; |
michael@0 | 2 | |
michael@0 | 3 | import android.hardware.Camera; |
michael@0 | 4 | import android.os.Build; |
michael@0 | 5 | |
michael@0 | 6 | public class testGetUserMedia extends BaseTest { |
michael@0 | 7 | public void testGetUserMedia() { |
michael@0 | 8 | String GUM_URL = getAbsoluteUrl("/robocop/robocop_getusermedia.html"); |
michael@0 | 9 | |
michael@0 | 10 | String GUM_MESSAGE = "Would you like to share your camera and microphone with"; |
michael@0 | 11 | String GUM_ALLOW = "Share"; |
michael@0 | 12 | String GUM_DENY = "Don't share"; |
michael@0 | 13 | |
michael@0 | 14 | blockForGeckoReady(); |
michael@0 | 15 | |
michael@0 | 16 | // Only try GUM test if the device has a camera. If there's a working Camera, |
michael@0 | 17 | // we'll assume there is a working audio device as well. |
michael@0 | 18 | // getNumberOfCameras is Gingerbread/9+ |
michael@0 | 19 | // We could avoid that requirement by trying to open a Camera but we |
michael@0 | 20 | // already know our 2.2/Tegra test devices don't have them. |
michael@0 | 21 | if (Build.VERSION.SDK_INT >= 9) { |
michael@0 | 22 | if (Camera.getNumberOfCameras() > 0) { |
michael@0 | 23 | // Test GUM notification |
michael@0 | 24 | inputAndLoadUrl(GUM_URL); |
michael@0 | 25 | waitForText(GUM_MESSAGE); |
michael@0 | 26 | mAsserter.is(mSolo.searchText(GUM_MESSAGE), true, "GetUserMedia doorhanger has been displayed"); |
michael@0 | 27 | } |
michael@0 | 28 | } |
michael@0 | 29 | } |
michael@0 | 30 | } |