Backed out changesets f2862e93b710, 4fe81f58dbef, and f8f855f0b7dc (bug 896353) for mochitest-1 asserts.

This commit is contained in:
Ryan VanderMeulen 2013-07-26 14:08:29 -04:00
parent 471c3597d6
commit 4bf6035d55
5 changed files with 2 additions and 78 deletions

View File

@ -115,9 +115,6 @@ private:
MediaRecorder::~MediaRecorder()
{
if (mStreamPort) {
mStreamPort->Destroy();
}
if (mTrackUnionStream) {
mTrackUnionStream->Destroy();
}
@ -195,7 +192,8 @@ MediaRecorder::Start(const Optional<int32_t>& aTimeSlice, ErrorResult& aResult)
MOZ_ASSERT(mEncoder, "CreateEncoder failed");
mTrackUnionStream->SetAutofinish(true);
mStreamPort = mTrackUnionStream->AllocateInputPort(mStream->GetStream(), MediaInputPort::FLAG_BLOCK_OUTPUT);
nsRefPtr<MediaInputPort> port =
mTrackUnionStream->AllocateInputPort(mStream->GetStream(), MediaInputPort::FLAG_BLOCK_OUTPUT);
if (mEncoder) {
mTrackUnionStream->AddListener(mEncoder);

View File

@ -110,8 +110,6 @@ protected:
nsRefPtr<DOMMediaStream> mStream;
// This media stream is used for notifying raw data to encoder and can be blocked.
nsRefPtr<ProcessedMediaStream> mTrackUnionStream;
// This is used for destroing the inputport when destroy the mediaRecorder
nsRefPtr<MediaInputPort> mStreamPort;
// This object creates on start() and destroys in ~MediaRecorder.
nsAutoPtr<EncodedBufferCache> mEncodedBufferCache;
// It specifies the container format as well as the audio and video capture formats.

View File

@ -116,7 +116,6 @@ MOCHITEST_FILES = \
test_video_to_canvas.html \
test_audiowrite.html \
test_mediarecorder_creation.html \
test_mediarecorder_record_audiocontext.html \
test_mozHasAudio.html \
test_source_media.html \
test_autoplay_contentEditable.html \

View File

@ -1,65 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test MediaRecorder Record AudioContext</title>
<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>
<script class="testbody" type="text/javascript">
function startTest() {
var context = new AudioContext();
var hasonstop = false;
var buffer = context.createBuffer(1, 80920, context.sampleRate);
for (var i = 0; i < 80920; ++i) {
buffer.getChannelData(0)[i] = Math.sin(1000 * 2 * Math.PI * i / context.sampleRate);
}
var source = context.createBufferSource();
source.buffer = buffer;
var dest = context.createMediaStreamDestination();
source.connect(dest);
var elem = document.createElement('audio');
elem.mozSrcObject = dest.stream;
mMediaStream = dest.stream;
source.start(0);
elem.play();
mMediaRecorder = new MediaRecorder(dest.stream);
mMediaRecorder.onwarning = function() {
ok(false, 'onwarning unexpectedly fired');
};
mMediaRecorder.onerror = function() {
ok(false, 'onerror unexpectedly fired');
};
mMediaRecorder.onstop = function() {
ok(true, 'onstop fired successfully');
is(mMediaRecorder.state, 'inactive', 'check recording status is inactive');
SimpleTest.finish();
};
mMediaRecorder.ondataavailable = function (e) {
if (mMediaRecorder.state == 'recording') {
is('audio/ogg', mMediaRecorder.mimeType, "check the record mimetype return " + mMediaRecorder.mimeType);
ok(e.data.size > 0, 'check blob has data');
mMediaRecorder.stop();
}
};
try {
mMediaRecorder.start(1000);
is('recording', mMediaRecorder.state, "check record state recording");
} catch (e) {
ok(false, 'Can t record audio context');
}
}
startTest();
SimpleTest.waitForExplicitFinish();
</script>
</pre>
</body>
</html>

View File

@ -5,7 +5,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "MediaStreamAudioDestinationNode.h"
#include "nsIDocument.h"
#include "mozilla/dom/AudioStreamTrack.h"
#include "mozilla/dom/MediaStreamAudioDestinationNodeBinding.h"
#include "AudioNodeEngine.h"
@ -74,11 +73,6 @@ MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode(AudioContext* a
MediaStreamDestinationEngine* engine = new MediaStreamDestinationEngine(this, tus);
mStream = aContext->Graph()->CreateAudioNodeStream(engine, MediaStreamGraph::INTERNAL_STREAM);
mPort = tus->AllocateInputPort(mStream, 0);
nsIDocument* doc = aContext->GetParentObject()->GetExtantDoc();
if (doc) {
mDOMStream->CombineWithPrincipal(doc->NodePrincipal());
}
}
void