Bug 1095278 - Part 4: Disable testGetUserMedia on release builds. r=rnewman
authorMichael Comella <michael.l.comella@gmail.com>
Mon, 29 Dec 2014 11:29:32 -0800
changeset 221499 3e5f3d222e219e0543e6df14b20e2fdf9f1263bc
parent 221498 92e3d07b6721986dca002faab9d368a81b1d162e
child 221500 a91703c279ec0c0c7fe16f20e1e28d6bad43450f
push id28031
push userkwierso@gmail.com
push dateTue, 30 Dec 2014 00:55:49 +0000
treeherdermozilla-central@62e3a9f26d21 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs1095278
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1095278 - Part 4: Disable testGetUserMedia on release builds. r=rnewman
mobile/android/base/tests/testGetUserMedia.java
--- a/mobile/android/base/tests/testGetUserMedia.java
+++ b/mobile/android/base/tests/testGetUserMedia.java
@@ -1,43 +1,55 @@
 package org.mozilla.gecko.tests;
 
+import org.mozilla.gecko.AppConstants;
+
 import android.widget.Spinner;
 import android.view.View;
+
 import com.jayway.android.robotium.solo.Condition;
+
 import android.hardware.Camera;
 import android.os.Build;
 
 public class testGetUserMedia extends BaseTest {
-    public void testGetUserMedia() {
-        String GUM_CAMERA_URL = getAbsoluteUrl("/robocop/robocop_getusermedia2.html");
-        String GUM_TAB_URL = getAbsoluteUrl("/robocop/robocop_getusermedia.html");
-        // Browser constraint needs HTTPS
-        String GUM_TAB_HTTPS_URL = GUM_TAB_URL.replace("http://mochi.test:8888", "https://example.com");
+    private static final String LOGTAG = testGetUserMedia.class.getSimpleName();
 
-        String GUM_MESSAGE = "Would you like to share your camera and microphone with";
-        String GUM_ALLOW = "^Share$";
-        String GUM_DENY = "^Don't Share$";
+    private static final String GUM_MESSAGE = "Would you like to share your camera and microphone with";
+    private static final String GUM_ALLOW = "^Share$";
+    private static final String GUM_DENY = "^Don't Share$";
+
+    private static final String GUM_BACK_CAMERA = "Back facing camera";
+    private static final String GUM_SELECT_TAB = "Choose a tab to stream";
 
-        String GUM_BACK_CAMERA = "Back facing camera";
-        String GUM_SELECT_TAB = "Choose a tab to stream";
+    private static final String GUM_PAGE_TITLE = "gUM Test Page";
+    private static final String GUM_PAGE_FAILED = "failed gumtest";
+    private static final String GUM_PAGE_AUDIO = "audio gumtest";
+    private static final String GUM_PAGE_VIDEO = "video gumtest";
+    private static final String GUM_PAGE_AUDIOVIDEO = "audiovideo gumtest";
 
-        String GUM_PAGE_TITLE = "gUM Test Page";
-        String GUM_PAGE_FAILED = "failed gumtest";
-        String GUM_PAGE_AUDIO = "audio gumtest";
-        String GUM_PAGE_VIDEO = "video gumtest";
-        String GUM_PAGE_AUDIOVIDEO = "audiovideo gumtest";
-
-        blockForGeckoReady();
+    public void testGetUserMedia() {
+        // TabShare.js is disabled on release builds.
+        if (AppConstants.RELEASE_BUILD) {
+            mAsserter.dumpLog(LOGTAG + " is disabled on release builds: returning");
+            return;
+        }
 
         // Only try GUM test if the device has a camera (emulation).
         if (Camera.getNumberOfCameras() <= 0) {
             return;
         }
 
+        blockForGeckoReady();
+
+        final String GUM_CAMERA_URL = getAbsoluteUrl("/robocop/robocop_getusermedia2.html");
+        final String GUM_TAB_URL = getAbsoluteUrl("/robocop/robocop_getusermedia.html");
+        // Browser constraint needs HTTPS
+        final String GUM_TAB_HTTPS_URL = GUM_TAB_URL.replace("http://mochi.test:8888", "https://example.com");
+
         // Tests on Camera page will test camera enumeration code, but
         // the actual cameras don't seem to work on the emulators, so
         // the enumeration is all that gets tested.
 
         // Test GUM notification showing
         inputAndLoadUrl(GUM_CAMERA_URL);
         waitForText(GUM_MESSAGE);
         mAsserter.is(mSolo.searchText(GUM_MESSAGE), true, "getUserMedia doorhanger has been displayed");