Bug 1019572 - Manually stop the media stream in test_permission_gum_remember.html. r=baku.
authorShih-Chiang Chien <schien@mozilla.com>
Thu, 05 Jun 2014 05:07:00 -0700
changeset 206271 3a3b6d6a8f2eed2071ddb8afee7e5aed90c6fe75
parent 206270 e28e73446d88c5d9bd56465916a26eab0a0e43ac
child 206272 c303feddaea218d37d5ce6b2f202cc28f2a7bb24
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1019572
milestone32.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 1019572 - Manually stop the media stream in test_permission_gum_remember.html. r=baku.
b2g/components/test/mochitest/test_permission_gum_remember.html
--- a/b2g/components/test/mochitest/test_permission_gum_remember.html
+++ b/b2g/components/test/mochitest/test_permission_gum_remember.html
@@ -47,18 +47,19 @@ var gTests = [
 function testGranted() {
   info('test remember permission granted');
   return new Promise(function(resolve, reject) {
     let steps = [].concat(gTests);
     function nextStep() {
       if (steps.length > 0) {
         let requestedType = steps.shift();
         info('getUserMedia for ' + JSON.stringify(requestedType));
-        navigator.mozGetUserMedia(requestedType, function success() {
+        navigator.mozGetUserMedia(requestedType, function success(stream) {
           ok(true, 'expected gUM success');
+          stream.stop();
           nextStep();
         }, function failure(err) {
           ok(false, 'unexpected gUM fail: ' + err);
           nextStep();
         });
       } else {
         resolve();
       }
@@ -74,18 +75,19 @@ function testGranted() {
 function testDenied() {
   info('test remember permission denied');
   return new Promise(function(resolve, reject) {
     let steps = [].concat(gTests);
     function nextStep() {
       if (steps.length > 0) {
         let requestedType = steps.shift();
         info('getUserMedia for ' + JSON.stringify(requestedType));
-        navigator.mozGetUserMedia(requestedType, function success() {
+        navigator.mozGetUserMedia(requestedType, function success(stream) {
           ok(false, 'unexpected gUM success');
+          stream.stop();
           nextStep();
         }, function failure(err) {
           ok(true, 'expected gUM fail: ' + err);
           nextStep();
         });
       } else {
         resolve();
       }
@@ -99,18 +101,19 @@ function testDenied() {
 }
 
 function testPartialDeniedAudio() {
   info('test remember permission partial denied: audio');
   return new Promise(function(resolve, reject) {
     info('getUserMedia for video and audio');
     function nextStep() {
       navigator.mozGetUserMedia({video: {facingMode: 'environment', required: ['facingMode']},
-                                 audio: true}, function success() {
+                                 audio: true}, function success(stream) {
         ok(false, 'unexpected gUM success');
+        stream.stop();
         resolve();
       }, function failure(err) {
         ok(true, 'expected gUM fail: ' + err);
         resolve();
       });
     }
 
     SpecialPowers.pushPermissions([
@@ -121,18 +124,19 @@ function testPartialDeniedAudio() {
 }
 
 function testPartialDeniedVideo() {
   info('test remember permission partial denied: video');
   return new Promise(function(resolve, reject) {
     info('getUserMedia for video and audio');
     function nextStep() {
       navigator.mozGetUserMedia({video: {facingMode: 'environment', required: ['facingMode']},
-                                 audio: true}, function success() {
+                                 audio: true}, function success(stream) {
         ok(false, 'unexpected gUM success');
+        stream.stop();
         resolve();
       }, function failure(err) {
         ok(true, 'expected gUM fail: ' + err);
         resolve();
       });
     }
 
     SpecialPowers.pushPermissions([