diff --git a/dom/media/test/test_mediarecorder_creation_fail.html b/dom/media/test/test_mediarecorder_creation_fail.html index 903bf1cc70c5..3c7498a09016 100644 --- a/dom/media/test/test_mediarecorder_creation_fail.html +++ b/dom/media/test/test_mediarecorder_creation_fail.html @@ -21,7 +21,7 @@ function startTest() { mediaRecorder.onerror = function (e) { is(callbackStep, 0, 'should fired onstop callback'); - is(e.name, 'GenericError', 'error name should be GenericError'); + is(e.error.name, 'UnknownError', 'error name should be UnknownError'); is(mediaRecorder.mimeType, '', 'mimetype should be empty'); is(mediaRecorder.state, 'recording', 'state is recording'); info('onerror callback fired'); diff --git a/dom/media/test/test_mediarecorder_getencodeddata.html b/dom/media/test/test_mediarecorder_getencodeddata.html index 426552ce73b5..dbd1c58d825d 100644 --- a/dom/media/test/test_mediarecorder_getencodeddata.html +++ b/dom/media/test/test_mediarecorder_getencodeddata.html @@ -30,7 +30,7 @@ SpecialPowers.pushPrefEnv({"set": [["media.ogg.enabled", false]]}, //fires again, so set it to null to avoid failures mediaRecorder.ondataavailable = null; SimpleTest.finish(); - } + }; mediaRecorder.ondataavailable = function(evt) { ondataavailableFired = true; ok(evt instanceof BlobEvent, @@ -43,16 +43,18 @@ SpecialPowers.pushPrefEnv({"set": [["media.ogg.enabled", false]]}, 'Blob data received should have type = ' + expectedMimeType); is(evt.target.mimeType, expectedMimeType, 'Mime type in ondataavailable = ' + expectedMimeType); - } + }; mediaRecorder.onerror = function(evt) { - ok(evt instanceof RecordErrorEvent, + ok(evt instanceof MediaRecorderErrorEvent, 'Events fired from onerror should be RecordErrorEvent'); is(evt.type, 'error', - 'Event type should onerror'); - is(evt.name, 'GenericError', - 'Event name is GenericError'); + 'Event type is error'); + ok(evt.error instanceof DOMException, + 'Events fired from onerror should have a DOMException in their error member'); + is(evt.error.name, 'UnknownError', 'Error name should be UnknownError.'); + is(evt.error.message, 'The operation failed for an unknown transient reason'); onErrorFired = true; - } + }; mediaRecorder.start(0); is(mediaRecorder.state, 'recording', 'Media recorder should be recording'); is(mediaRecorder.stream, stream, diff --git a/dom/media/test/test_mediarecorder_principals.html b/dom/media/test/test_mediarecorder_principals.html index 3c09a7b10058..4536c767ea38 100644 --- a/dom/media/test/test_mediarecorder_principals.html +++ b/dom/media/test/test_mediarecorder_principals.html @@ -89,9 +89,9 @@ function testPrincipals(resource) { hasStopped = new Promise(resolve => rec.onstop = resolve); video.play(); }) - .then(() => ok(true, msgNoThrow), e => is(e.name, null, msgNoThrow)) + .then(() => ok(true, msgNoThrow), e => is(e.error.name, null, msgNoThrow)) .then(() => Promise.race([ - new Promise((_, reject) => rec.onerror = e => reject(new DOMException("", e.name))), + new Promise((_, reject) => rec.onerror = e => reject(e.error)), hasEnded ])) .then(() => ok(false, msgSecErr), e => is(e.name, "SecurityError", msgSecErr)) diff --git a/dom/media/test/test_mediarecorder_unsupported_src.html b/dom/media/test/test_mediarecorder_unsupported_src.html index cbbc82e7d6b9..17580a613642 100644 --- a/dom/media/test/test_mediarecorder_unsupported_src.html +++ b/dom/media/test/test_mediarecorder_unsupported_src.html @@ -42,7 +42,7 @@ function startTest() { } } ok(callbackStep < 3, 'onerror callback fired as expected.'); - is(e.name, 'GenericError', 'Error name should be GenericError.'); + is(e.error.name, 'UnknownError', 'Error name should be UnknownError.'); is(mediaRecorder.mimeType, '', 'mimetype should be empty'); is(mediaRecorder.state, 'recording', 'state is recording'); info('onerror callback fired');