Backed out 2 changesets (bug 1690976) for ES lint failure in test_decode_error_crossorigin.html CLOSED TREE

Backed out changeset ed0ab9078607 (bug 1690976)
Backed out changeset c6c868eaf915 (bug 1690976)
This commit is contained in:
Bogdan Tara 2021-02-08 13:34:59 +02:00
Родитель 1b7149f584
Коммит 647a1a6efc
3 изменённых файлов: 1 добавлений и 62 удалений

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

@ -5405,10 +5405,8 @@ void HTMLMediaElement::DecodeError(const MediaResult& aError) {
}
} else if (mReadyState == HAVE_NOTHING) {
NoSupportedMediaSourceError(aError.Description());
} else if (IsCORSSameOrigin()) {
Error(MEDIA_ERR_DECODE, aError.Description());
} else {
Error(MEDIA_ERR_DECODE, "Failed to decode media"_ns);
Error(MEDIA_ERR_DECODE, aError.Description());
}
}

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

@ -750,7 +750,6 @@ skip-if = toolkit == 'android' # bug 1108558, android(bug 1232305)
[test_cueless_webm_seek-3.html]
[test_currentTime.html]
[test_decode_error.html]
[test_decode_error_crossorigin.html]
[test_decoder_disable.html]
[test_defaultMuted.html]
[test_delay_load.html]

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

@ -1,58 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Invalid formats raise decode errors with default messages for CORS cross-origin media</title>
<script 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>
<pre id="test">
<script class="testbody" type="text/javascript">
var manager = new MediaTestManager;
var gotErrSrcNotSupported = false;
var gotErrDecode = false;
function startTest(test, token) {
const ok = function(condition, name) {
SimpleTest.ok(condition, `${test.name}: ${name}`);
}
const is = function(a, b, name) {
SimpleTest.is(a, b, `${test.name}: ${name}`);
}
const v = document.createElement("video");
manager.started(token);
v.addEventListener("error", event => {
if (v.readyState == v.HAVE_NOTHING) {
is(v.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED,
"Expected code for a load error");
is(v.error.message, "Failed to open media",
"Expected message for a load error");
gotErrSrcNotSupported = true;
} else {
is(v.error.code, MediaError.MEDIA_ERR_DECODE,
"Expected code for a decode error");
is(v.error.message, "Failed to decode media",
"Expected message for a decode error");
gotErrDecode = true;
}
manager.finished(token);
});
v.autoplay = true;
// CORS-cross-origin URL.
v.src = `http://example.com/tests/dom/media/test/${test.name}`;
}
gTestPrefs.push(["media.cache_size", 40000]);
manager.onFinished = () => {
ok(gotErrSrcNotSupported, "At least one test led to src-not-supported");
ok(gotErrDecode, "At least one test led to a decode error");
};
manager.runTests(gErrorTests, startTest);
</script>
</pre>
</body>
</html>