Backed out changeset 57e490053263 (bug 1018928) for causing the intermittent test failures in bug 1032991
authorEd Morley <emorley@mozilla.com>
Thu, 03 Jul 2014 13:53:15 +0100
changeset 192190 2ff73cfaac1300bc4fae71eb3796a9a411b39868
parent 192189 1cea3e0939e2f8376c74d4f26e85ff938b169e55
child 192191 94315f0066383882479b3a54550e951bd4b0b6f1
push idunknown
push userunknown
push dateunknown
bugs1018928, 1032991
milestone33.0a1
backs out57e490053263673dea1e55f0a7388655a16bf05b
Backed out changeset 57e490053263 (bug 1018928) for causing the intermittent test failures in bug 1032991
mobile/android/base/tests/robocop.ini
mobile/android/base/tests/robocop_getusermedia.html
mobile/android/base/tests/testGetUserMedia.java
--- a/mobile/android/base/tests/robocop.ini
+++ b/mobile/android/base/tests/robocop.ini
@@ -35,18 +35,16 @@ skip-if = android_version == "10" || pro
 skip-if = android_version == "10"
 [testFilterOpenTab]
 # [testFindInPage] # see bug 975155, bug 1014708
 [testFlingCorrectness]
 # disabled on x86 only; bug 927476
 skip-if = processor == "x86"
 [testFormHistory]
 [testGetUserMedia]
-# disabled on 2.3; see bug 981881]
-skip-if = android_version == "10"
 # [testHistory] # see bug 915350
 [testHomeBanner]
 # disabled on x86 only; bug 957185
 skip-if = processor == "x86"
 [testImportFromAndroid]
 # disabled on x86 and 2.3; bug 900664, 979552
 skip-if = android_version == "10" || processor == "x86"
 [testInputUrlBar]
--- a/mobile/android/base/tests/robocop_getusermedia.html
+++ b/mobile/android/base/tests/robocop_getusermedia.html
@@ -1,28 +1,24 @@
 <!DOCTYPE html>
 <html><head>
   <title>gUM Test Page</title>
   <meta http-equiv="content-type" content="text/html; charset=UTF-8" charset="utf-8">
 </head>
 <body>
-  <div id="content"></div>
   <script type="application/javascript">
   var video_status = false;
   var video = document.createElement("video");
   video.setAttribute("width", 640);
   video.setAttribute("height", 480);
 
   var audio_status = false;
   var audio = document.createElement("audio");
   audio.setAttribute("controls", true);
 
-  var content = document.getElementById("content");
-  document.title = "gUM Test Page";
-
   startAudioVideo();
 
   function startAudioVideo() {
     video_status = true;
     audio_status = true;
     startMedia({video:true, audio:true});
   }
 
@@ -40,38 +36,28 @@
       content.removeChild(audio);
       audio_status = false;
     }
   }
 
   function startMedia(param) {
     try {
       window.navigator.mozGetUserMedia(param, function(stream) {
+        message.innerHTML = "<p>Success!</p>";
         if (video_status) {
           content.appendChild(video);
           video.mozSrcObject = stream;
           video.play();
         }
         if (audio_status) {
           content.appendChild(audio);
           audio.mozSrcObject = stream;
           audio.play();
         }
-        var audioTracks = stream.getAudioTracks();
-        var videoTracks = stream.getVideoTracks();
-        document.title = "";
-        if (audioTracks.length > 0) {
-          document.title += "audio";
-        }
-        if (videoTracks.length > 0) {
-          document.title += "video";
-        }
-        document.title += " gumtest";
       }, function(err) {
-        document.title = "failed gumtest";
         stopMedia();
       });
     } catch(e) {
       stopMedia();
     }
   }
 </script>
-</body></html>
+</body></html>
\ No newline at end of file
--- a/mobile/android/base/tests/testGetUserMedia.java
+++ b/mobile/android/base/tests/testGetUserMedia.java
@@ -3,65 +3,28 @@ package org.mozilla.gecko.tests;
 import android.hardware.Camera;
 import android.os.Build;
 
 public class testGetUserMedia extends BaseTest {
     public void testGetUserMedia() {
         String GUM_URL = getAbsoluteUrl("/robocop/robocop_getusermedia.html");
 
         String GUM_MESSAGE = "Would you like to share your camera and microphone with";
-        String GUM_ALLOW = "^Share$";
-        String GUM_DENY = "^Don't Share$";
-
-        String GUM_PAGE_FAILED = "failed gumtest";
-        String GUM_PAGE_AUDIO = "audio gumtest";
-        String GUM_PAGE_VIDEO = "video gumtest";
-        String GUM_PAGE_AUDIOVIDEO = "audiovideo gumtest";
+        String GUM_ALLOW = "Share";
+        String GUM_DENY = "Don't share";
 
         blockForGeckoReady();
 
         // Only try GUM test if the device has a camera. If there's a working Camera,
         // we'll assume there is a working audio device as well.
         // getNumberOfCameras is Gingerbread/9+
         // We could avoid that requirement by trying to open a Camera but we
         // already know our 2.2/Tegra test devices don't have them.
-        if (Build.VERSION.SDK_INT < 9) {
-            return;
-        }
-
-        if (Camera.getNumberOfCameras() <= 0) {
-            return;
+        if (Build.VERSION.SDK_INT >= 9) {
+            if (Camera.getNumberOfCameras() > 0) {
+                // Test GUM notification
+                inputAndLoadUrl(GUM_URL);
+                waitForText(GUM_MESSAGE);
+                mAsserter.is(mSolo.searchText(GUM_MESSAGE), true, "GetUserMedia doorhanger has been displayed");
+            }
         }
-        // Test GUM notification showing
-        inputAndLoadUrl(GUM_URL);
-        waitForText(GUM_MESSAGE);
-        mAsserter.is(mSolo.searchText(GUM_MESSAGE), true, "GetUserMedia doorhanger has been displayed");
-        mSolo.clickOnButton(GUM_DENY);
-        verifyPageTitle(GUM_PAGE_FAILED);
-
-        inputAndLoadUrl(GUM_URL);
-        waitForText(GUM_MESSAGE);
-        // Cameras don't work on the testing hardware, so stream a tab
-        mSolo.clickOnText("Back facing camera");
-        mSolo.clickOnText("Choose a tab to stream");
-        mSolo.clickOnButton(GUM_ALLOW);
-        mSolo.clickOnText("gUM Test Page");
-        verifyPageTitle(GUM_PAGE_AUDIOVIDEO);
-
-        inputAndLoadUrl(GUM_URL);
-        waitForText(GUM_MESSAGE);
-        mSolo.clickOnText("Back facing camera");
-        mSolo.clickOnText("No Video");
-        mSolo.clickOnButton(GUM_ALLOW);
-        verifyPageTitle(GUM_PAGE_AUDIO);
-
-        inputAndLoadUrl(GUM_URL);
-        waitForText(GUM_MESSAGE);
-        // Cameras don't work on the testing hardware, so stream a tab
-        mSolo.clickOnText("Back facing camera");
-        mSolo.clickOnText("Choose a tab to stream");
-        mSolo.clickOnText("Microphone 1");
-        mSolo.clickOnText("No Audio");
-        mSolo.clickOnButton(GUM_ALLOW);
-        mSolo.clickOnText("gUM Test Page");
-        verifyPageTitle(GUM_PAGE_VIDEO);
     }
 }