mobile/android/base/tests/testGetUserMedia.java

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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