Bug 969372 - Move mediaRecorder in global scope to avoid test timeout. r=jsmith, a=test-only
authorRandy Lin <rlin@mozilla.com>
Wed, 07 May 2014 23:50:57 +0800
changeset 192228 e532119b92ab
parent 192227 d43267eaf528
child 192231 306759b08bbf
child 192232 291347b1257b
push id3532
push userryanvm@gmail.com
push date2014-05-08 15:27 +0000
Treeherderresults
reviewersjsmith, test-only
bugs969372
milestone30.0
Bug 969372 - Move mediaRecorder in global scope to avoid test timeout. r=jsmith, a=test-only
content/media/test/test_mediarecorder_record_no_timeslice.html
--- a/content/media/test/test_mediarecorder_record_no_timeslice.html
+++ b/content/media/test/test_mediarecorder_record_no_timeslice.html
@@ -5,33 +5,35 @@
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
   <script type="text/javascript" src="manifest.js"></script>
 </head>
 <body>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 var manager = new MediaTestManager;
+// Need to clarify why declare mediaRecorder in startTest cause timeout.;
+var mediaRecorder;
 
 /**
  * Starts a test on every media recorder file included to check that a
  * stream derived from the file can be recorded with no time slice provided.
  */
 function startTest(test, token) {
   var element = document.createElement('audio');
   var expectedMimeType = test.type.substring(0, test.type.indexOf(';'));
 
   element.token = token;
   manager.started(token);
 
   element.src = test.name;
   element.test = test;
   element.stream = element.mozCaptureStreamUntilEnded();
 
-  var mediaRecorder = new MediaRecorder(element.stream);
+  mediaRecorder = new MediaRecorder(element.stream);
   var onStopFired = false;
   var onDataAvailableFired = false;
 
   mediaRecorder.onerror = function () {
     ok(false, 'Unexpected onerror callback fired');
   };
 
   mediaRecorder.onwarning = function () {