From 670f93312de19686c33b0e8221cafa70862f6807 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Tue, 13 Sep 2016 11:15:57 +1000 Subject: [PATCH] Bug 1299072: P16. Add mochitest. r=gerald MozReview-Commit-ID: FRb74jIAyLN --HG-- extra : rebase_source : 70004e5ae9da8ac7fc8957a2eb3c6600c60a19d7 --- dom/media/test/test_decode_error.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dom/media/test/test_decode_error.html b/dom/media/test/test_decode_error.html index 58d4c429997e..2a5d9998c3b5 100644 --- a/dom/media/test/test_decode_error.html +++ b/dom/media/test/test_decode_error.html @@ -27,6 +27,8 @@ function startTest(test, token) { ok(el.error, "Element 'error' attr expected to have a value"); ok(el.error instanceof MediaError, "Element 'error' attr expected to be MediaError"); is(el.error.code, MediaError.MEDIA_ERR_DECODE, "Expected a decode error"); + ok(typeof el.error.message === 'string' || el.error.essage instanceof String, "Element 'message' attr expected to be a string"); + ok(el.error.message.length > 0, "Element 'message' attr has content"); el._sawError = true; manager.finished(token); }, false); @@ -46,7 +48,12 @@ function startTest(test, token) { } SimpleTest.waitForExplicitFinish(); -SpecialPowers.pushPrefEnv({"set": [["media.cache_size", 40000]]}, beginTest); +SpecialPowers.pushPrefEnv({ + "set": [ + ["media.cache_size", 40000], + ["dom.MediaError.message.enabled", true] + ] +}, beginTest); function beginTest() { manager.runTests(gDecodeErrorTests, startTest); }