Bug 1128448 - 1. Close the pref media.encoder.omx.enabled for newer android version. 2. Modify testcase and MR to eusure no timing issue. r=roc

This commit is contained in:
Benjamin Chen 2015-05-25 17:37:45 +08:00
parent ff838d5c79
commit 6683f44482
2 changed files with 10 additions and 9 deletions

View File

@ -638,14 +638,13 @@ private:
void DoSessionEndTask(nsresult rv)
{
MOZ_ASSERT(NS_IsMainThread());
CleanupStreams();
if (NS_FAILED(rv)) {
nsCOMPtr<nsIRunnable> runnable =
NS_NewRunnableMethodWithArg<nsresult>(mRecorder,
&MediaRecorder::NotifyError, rv);
NS_DispatchToMainThread(runnable);
}
CleanupStreams();
if (NS_FAILED(NS_DispatchToMainThread(new EncoderErrorNotifierRunnable(this)))) {
MOZ_ASSERT(false, "NS_DispatchToMainThread EncoderErrorNotifierRunnable failed");
}

View File

@ -26,6 +26,13 @@ function startTest() {
mediaRecorder.onerror = function (e) {
callbackStep++;
if (callbackStep == 1) {
try {
mediaRecorder.pause();
} catch(e) {
ok(false, 'Should not get exception in pause call.');
}
}
ok(callbackStep < 3, 'onerror callback fired as expected.');
is(e.name, 'GenericError', 'Error name should be GenericError.');
is(mediaRecorder.mimeType, '', 'mimetype should be empty');
@ -60,12 +67,6 @@ function startTest() {
} catch(e) {
ok(false, 'Should not get exception in start call.');
}
try {
mediaRecorder.pause();
} catch(e) {
ok(false, 'Should not get exception in pause call.');
}
},
function(err) {
ok(false, 'Unexpected error fired with: ' + err);
@ -81,7 +82,8 @@ SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv(
{
"set": [
["media.encoder.webm.enabled", false]
["media.encoder.webm.enabled", false],
["media.encoder.omx.enabled", false]
]
}, startTest);