Remove test for <math> which fails when Extension:Math is installed
authorTim Starling <tstarling@wikimedia.org>
Wed, 28 Sep 2016 00:17:50 +0000 (10:17 +1000)
committerTim Starling <tstarling@wikimedia.org>
Thu, 29 Sep 2016 02:07:43 +0000 (12:07 +1000)
And add a test for <mw:toc>

C. Scott asked for this test to be added in CR on
Ib48b91238c3eddd6a86b62, but it was never actually executed prior to
Ic840678b851d6fc472b834 due to a TestFileReader bug. The nuisance it
causes now becomes apparent.

As was noted at the time, it is unnecessary because Tidy is not a
sanitization pass, <math> is not whitelisted in the Sanitizer. C. Scott
said "I was just concerned that the particular means used to hide the
mathml from tidy might also hide it from the sanitizer." I don't think
that's plausible, but we can test for it anyway by trying to pass
<mw:toc> elements through the Sanitizer.

Change-Id: I5928e6f31d8b80ef384a1c0e6bacfa789cac9770

tests/parser/parserTests.txt

index ff1450b..ad96138 100644 (file)
@@ -16711,11 +16711,11 @@ Expansion of multi-line templates in attribute values (bug 6255 sanity check 2)
 !! end
 
 !! test
 !! end
 
 !! test
-evil <math>-wiki-tags without Extension:Math enabled
+Tags which are hidden from Tidy cannot pass through the Sanitizer
 !! wikitext
 !! wikitext
-<math><img src="some evil external link"><script>some_evil_javascript();</script></math>
+<mw:toc><script>alert();</script></mw:toc>
 !! html+tidy
 !! html+tidy
-<p>&lt;math&gt;&lt;img src="some evil external link"&gt;&lt;script&gt;some_evil_javascript();&lt;/script&gt;&lt;/math&gt;</p>
+<p>&lt;mw:toc&gt;&lt;script&gt;alert();&lt;/script&gt;&lt;/mw:toc&gt;</p>
 !! end
 
 ###
 !! end
 
 ###