diff --git a/lib/tests/htmlpurifier_test.php b/lib/tests/htmlpurifier_test.php
index 31e3e53c46a..e2924af2968 100644
--- a/lib/tests/htmlpurifier_test.php
+++ b/lib/tests/htmlpurifier_test.php
@@ -327,7 +327,7 @@ class core_htmlpurifier_testcase extends basic_testcase {
* @param string $expected expected result
*/
public function test_media_tags($mediatag, $expected) {
- $actual = format_text($mediatag, FORMAT_MOODLE, ['filter' => false, 'noclean' => true]);
+ $actual = format_text($mediatag, FORMAT_MOODLE, ['filter' => false]);
$this->assertEquals($expected, $actual);
}
@@ -353,8 +353,8 @@ class core_htmlpurifier_testcase extends basic_testcase {
$videoattrs = [
'crossorigin="anonymous"', 'crossorigin="use-credentials"',
'poster="https://upload.wikimedia.org/wikipedia/en/1/14/Space_jam.jpg"',
- 'preload=""', 'autoplay=""', 'playsinline=""', 'loop=""', 'muted=""',
- 'controls=""', 'width="420px"', 'height="69px"'
+ 'preload="auto"', 'autoplay=""', 'playsinline=""', 'loop=""', 'muted=""',
+ 'controls=""', 'width="420"', 'height="69"'
];
return $generatetestcases('Plain audio', $audioattrs + ['src="http://example.com/jam.wav"'], [
'',
@@ -363,7 +363,7 @@ class core_htmlpurifier_testcase extends basic_testcase {
'',
'
' .
'
' .
'
'
@@ -375,21 +375,46 @@ class core_htmlpurifier_testcase extends basic_testcase {
'No tasty jams for you.' .
'',
'' .
- '
'
+ ]) + $generatetestcases('Audio with sources and tracks', $audioattrs, [
+ '' .
+ '' .
+ '',
+ '' .
+ '
' .
+ '' .
+ '' .
+ '' .
'No tasty jams for you.' .
'' .
'
'
]) + $generatetestcases('Plain video', $videoattrs + ['src="http://example.com/prettygood.mp4'], [
'',
''
+ ]) + $generatetestcases('Video with illegal subtag', $videoattrs + ['src="http://example.com/prettygood.mp4'], [
+ '',
+ ''
+ ]) + $generatetestcases('Video with legal subtag', $videoattrs + ['src="http://example.com/prettygood.mp4'], [
+ '',
+ ''
+ ]) + $generatetestcases('Source tag without video or audio', $videoattrs, [
+ 'some text the end',
+ 'some text the end
'
]) + $generatetestcases('Video with one source', $videoattrs, [
'',
'' .
'' .
'
'
@@ -397,38 +422,50 @@ class core_htmlpurifier_testcase extends basic_testcase {
'',
'' .
'' .
'
'
- ] + [
- 'Video with invalid crossorigin' => [
- '