Bug 1299072: P16. Add mochitest. r=gerald

MozReview-Commit-ID: FRb74jIAyLN

--HG--
extra : rebase_source : 70004e5ae9da8ac7fc8957a2eb3c6600c60a19d7
This commit is contained in:
Jean-Yves Avenard 2016-09-13 11:15:57 +10:00
Родитель 829f0d44fc
Коммит 670f93312d
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -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);
}