mobile/android/base/tests/testGetUserMedia.java

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

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

mercurial