Arlolra has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/349719 )

Change subject: Sync up with Parsoid timedMediaHandlerParserTests.txt
......................................................................

Sync up with Parsoid timedMediaHandlerParserTests.txt

This now aligns with Parsoid commit b05fcc3ffa48fe9b44249978c6115a636e48dadc

Change-Id: I1efbb82fe8f72f8de611b855d9ebb59786cb5449
---
M tests/parserTests.txt
1 file changed, 55 insertions(+), 19 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/19/349719/1

diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index fb04e5f..a07ff4f 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -2,22 +2,24 @@
 Simple video element
 !! wikitext
 [[File:Video.ogv]]
-!! html
+!! html/php
 <div class="mediaContainer" style="width:320px"><video id="mwe_player_1" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg"; 
controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local"><source 
src="http://example.com/images/0/00/Video.ogv"; type="video/ogg; 
codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 × 240 (590 kbps)" 
data-shorttitle="Ogg source" data-width="320" data-height="240" 
data-bandwidth="590013" data-framerate="30"/></video></div>
 
-!! html+tidy
+!! html/php+tidy
 <div class="mediaContainer" style="width:320px"><video id="mwe_player_1" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg"; 
controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local">
 <source src="http://example.com/images/0/00/Video.ogv"; type="video/ogg; 
codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 × 240 (590 kbps)" 
data-shorttitle="Ogg source" data-width="320" data-height="240" 
data-bandwidth="590013" data-framerate="30" /></video></div>
-!!end
+!! html/parsoid
+<p><span class="mw-default-size" typeof="mw:Video"><span><video controls="" 
preload="none" height="240" width="320" resource="./File:Video.ogv"><source 
src="http://example.com/images/0/00/Video.ogv"; type="application/ogg" 
data-file-width="320" data-file-height="240"/></video></span></span></p>
+!! end
 
 !! test
 Simple thumbed video
 !! wikitext
 [[File:Video.ogv|thumb]]
-!! html
+!! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><div 
id="mwe_player_1" class="PopUpMediaTransform" style="width:180px;" 
videopayload="&lt;div class=&quot;mediaContainer&quot; 
style=&quot;width:320px&quot;&gt;&lt;video id=&quot;mwe_player_2&quot; 
poster=&quot;http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg&quot;
 controls=&quot;&quot; preload=&quot;none&quot; autoplay=&quot;&quot; 
style=&quot;width:320px;height:240px&quot; class=&quot;kskin&quot; 
data-durationhint=&quot;4.3666666666667&quot; data-startoffset=&quot;0&quot; 
data-mwtitle=&quot;Video.ogv&quot; 
data-mwprovider=&quot;local&quot;&gt;&lt;source 
src=&quot;http://example.com/images/0/00/Video.ogv&quot; type=&quot;video/ogg; 
codecs=&amp;quot;theora&amp;quot;&quot; data-title=&quot;Original Ogg file, 320 
× 240 (590 kbps)&quot; data-shorttitle=&quot;Ogg source&quot; 
data-width=&quot;320&quot; data-height=&quot;240&quot; 
data-bandwidth=&quot;590013&quot; 
data-framerate=&quot;30&quot;/&gt;&lt;/video&gt;&lt;/div&gt;"><img 
alt="File:Video.ogv" style="width:180px;height:135px" 
src="http://example.com/images/thumb/0/00/Video.ogv/180px--Video.ogv.jpg";></img><a
 href="http://example.com/images/0/00/Video.ogv"; title="Play media" 
target="new"><span class="play-btn-large"><span class="mw-tmh-playtext">Play 
media</span></span></a></div>  <div class="thumbcaption"><div 
class="magnify"><a href="/wiki/File:Video.ogv" class="internal" 
title="Enlarge"></a></div></div></div></div>
 
-!! html+tidy
+!! html/php+tidy
 <div class="thumb tright">
 <div class="thumbinner" style="width:182px;">
 <div id="mwe_player_1" class="PopUpMediaTransform" style="width:180px;" 
videopayload="&lt;div class=&quot;mediaContainer&quot; 
style=&quot;width:320px&quot;&gt;&lt;video id=&quot;mwe_player_2&quot; 
poster=&quot;http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg&quot;
 controls=&quot;&quot; preload=&quot;none&quot; autoplay=&quot;&quot; 
style=&quot;width:320px;height:240px&quot; class=&quot;kskin&quot; 
data-durationhint=&quot;4.3666666666667&quot; data-startoffset=&quot;0&quot; 
data-mwtitle=&quot;Video.ogv&quot; 
data-mwprovider=&quot;local&quot;&gt;&lt;source 
src=&quot;http://example.com/images/0/00/Video.ogv&quot; type=&quot;video/ogg; 
codecs=&amp;quot;theora&amp;quot;&quot; data-title=&quot;Original Ogg file, 320 
× 240 (590 kbps)&quot; data-shorttitle=&quot;Ogg source&quot; 
data-width=&quot;320&quot; data-height=&quot;240&quot; 
data-bandwidth=&quot;590013&quot; 
data-framerate=&quot;30&quot;/&gt;&lt;/video&gt;&lt;/div&gt;"><img 
alt="File:Video.ogv" style="width:180px;height:135px" 
src="http://example.com/images/thumb/0/00/Video.ogv/180px--Video.ogv.jpg"; /><a 
href="http://example.com/images/0/00/Video.ogv"; title="Play media" 
target="new"><span class="play-btn-large"><span class="mw-tmh-playtext">Play 
media</span></span></a></div>
@@ -26,13 +28,21 @@
 </div>
 </div>
 </div>
-!!end
+!! html/parsoid
+<figure class="mw-default-size" typeof="mw:Video/Thumb"><span><video 
poster="//example.com/images/thumb/0/00/Video.ogv/220px-Video.ogv" controls="" 
preload="none" height="165" width="220" resource="./File:Video.ogv"><source 
src="http://example.com/images/0/00/Video.ogv"; type="application/ogg" 
data-file-width="320" data-file-height="240"/></video></span></figure>
+!! end
 
 !! test
 Video in a <gallery>
+!! options
+parsoid={
+  "nativeGallery": true
+}
 !! wikitext
-<gallery>File:Video.ogv</gallery>
-!! html
+<gallery>
+File:Video.ogv
+</gallery>
+!! html/php
 <ul class="gallery mw-gallery-traditional">
                <li class="gallerybox" style="width: 155px"><div style="width: 
155px">
                        <div class="thumb" style="width: 150px;"><div 
style="margin:30px auto;"><div id="mwe_player_1" class="PopUpMediaTransform" 
style="width:120px;" videopayload="&lt;div class=&quot;mediaContainer&quot; 
style=&quot;width:320px&quot;&gt;&lt;video id=&quot;mwe_player_2&quot; 
poster=&quot;http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg&quot;
 controls=&quot;&quot; preload=&quot;none&quot; autoplay=&quot;&quot; 
style=&quot;width:320px;height:240px&quot; class=&quot;kskin&quot; 
data-durationhint=&quot;4.3666666666667&quot; data-startoffset=&quot;0&quot; 
data-mwtitle=&quot;Video.ogv&quot; 
data-mwprovider=&quot;local&quot;&gt;&lt;source 
src=&quot;http://example.com/images/0/00/Video.ogv&quot; type=&quot;video/ogg; 
codecs=&amp;quot;theora&amp;quot;&quot; data-title=&quot;Original Ogg file, 320 
× 240 (590 kbps)&quot; data-shorttitle=&quot;Ogg source&quot; 
data-width=&quot;320&quot; data-height=&quot;240&quot; 
data-bandwidth=&quot;590013&quot; 
data-framerate=&quot;30&quot;/&gt;&lt;/video&gt;&lt;/div&gt;"><img 
alt="File:Video.ogv" style="width:120px;height:90px" 
src="http://example.com/images/thumb/0/00/Video.ogv/120px--Video.ogv.jpg";></img><a
 href="http://example.com/images/0/00/Video.ogv"; title="Play media" 
target="new"><span class="play-btn-large"><span class="mw-tmh-playtext">Play 
media</span></span></a></div></div></div>
@@ -41,70 +51,96 @@
                </div></li>
 </ul>
 
-!!end
+!! html/parsoid
+<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" 
about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 
150px; height: 150px;"><span style="display: inline-block; height: 100%; 
vertical-align: middle;"></span><span typeof="mw:Video" style="vertical-align: 
middle; display: inline-block;"><span><video 
poster="//example.com/images/thumb/0/00/Video.ogv/120px-Video.ogv" controls="" 
preload="none" height="90" width="120" resource="./File:Video.ogv"><source 
src="http://example.com/images/0/00/Video.ogv"; type="application/ogg" 
data-file-width="320" data-file-height="240"/></video></span></span></div><div 
class="gallerytext"></div></li>
+</ul>
+!! end
 
 !! test
 Video with thumbtime=1:25
 !! wikitext
 [[File:Video.ogv|thumbtime=1:25]]
-!! html
+!! html/php
 <div class="mediaContainer" style="width:320px"><video id="mwe_player_1" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px-seek%3D3.3666666666667-Video.ogv.jpg";
 controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local"><source 
src="http://example.com/images/0/00/Video.ogv"; type="video/ogg; 
codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 × 240 (590 kbps)" 
data-shorttitle="Ogg source" data-width="320" data-height="240" 
data-bandwidth="590013" data-framerate="30"/></video></div>
 
+!! html/parsoid
+<p><span class="mw-default-size" typeof="mw:Video" 
data-mw='{"thumbtime":"1:25"}'><span><video controls="" preload="none" 
height="240" width="320" resource="./File:Video.ogv"><source 
src="http://example.com/images/0/00/Video.ogv"; type="application/ogg" 
data-file-width="320" data-file-height="240"/></video></span></span></p>
 !! end
 
 !! test
 Video with starttime offset
 !! wikitext
 [[File:Video.ogv|start=1:25]]
-!! html
+!! html/php
 <div class="mediaContainer" style="width:320px"><video id="mwe_player_1" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px-seek%3D3.3666666666667-Video.ogv.jpg";
 controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local"><source 
src="http://example.com/images/0/00/Video.ogv#t=00:00:03.366"; type="video/ogg; 
codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 × 240 (590 kbps)" 
data-shorttitle="Ogg source" data-width="320" data-height="240" 
data-bandwidth="590013" data-framerate="30"/></video></div>
 
+!! html/parsoid
+<p><span class="mw-default-size" typeof="mw:Video" 
data-mw='{"starttime":"1:25"}'><span><video controls="" preload="none" 
height="240" width="320" resource="./File:Video.ogv"><source 
src="http://example.com/images/0/00/Video.ogv#t=85"; type="application/ogg" 
data-file-width="320" data-file-height="240"/></video></span></span></p>
 !! end
 
 !! test
 Video with starttime and endtime offsets
 !! wikitext
 [[File:Video.ogv|start=1:25|end=1:35]]
-!! html
+!! html/php
 <div class="mediaContainer" style="width:320px"><video id="mwe_player_1" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px-seek%3D3.3666666666667-Video.ogv.jpg";
 controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local"><source 
src="http://example.com/images/0/00/Video.ogv#t=00:00:03.366,00:00:03.366"; 
type="video/ogg; codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 
× 240 (590 kbps)" data-shorttitle="Ogg source" data-width="320" 
data-height="240" data-bandwidth="590013" data-framerate="30"/></video></div>
 
+!! html/parsoid
+<p><span class="mw-default-size" typeof="mw:Video" 
data-mw='{"starttime":"1:25","endtime":"1:35"}'><span><video controls="" 
preload="none" height="240" width="320" resource="./File:Video.ogv"><source 
src="http://example.com/images/0/00/Video.ogv#t=85,95"; type="application/ogg" 
data-file-width="320" data-file-height="240"/></video></span></span></p>
 !! end
 
 !! test
 Video with unsupported alt
 !! wikitext
 [[File:Video.ogv|alt=Test]]
-!! html
+!! html/php
 <div class="mediaContainer" style="width:320px"><video id="mwe_player_1" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg"; 
controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local"><source 
src="http://example.com/images/0/00/Video.ogv"; type="video/ogg; 
codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 × 240 (590 kbps)" 
data-shorttitle="Ogg source" data-width="320" data-height="240" 
data-bandwidth="590013" data-framerate="30"/></video></div>
 
+!! html/parsoid
+<p><span class="mw-default-size" typeof="mw:Video" 
data-mw='{"attribs":[["alt",{"html":"alt=Test"}]]}'><span><video controls="" 
preload="none" height="240" width="320" resource="./File:Video.ogv"><source 
src="http://example.com/images/0/00/Video.ogv"; type="application/ogg" 
data-file-width="320" data-file-height="240"/></video></span></span></p>
 !! end
 
 !! test
 Video with unsupported link
 !! wikitext
 [[File:Video.ogv|link=Example]]
-!! html
+!! html/php
 <div class="mediaContainer" style="width:320px"><video id="mwe_player_1" 
poster="http://example.com/images/thumb/0/00/Video.ogv/320px--Video.ogv.jpg"; 
controls="" preload="none" style="width:320px;height:240px" class="kskin" 
data-durationhint="4.3666666666667" data-startoffset="0" 
data-mwtitle="Video.ogv" data-mwprovider="local"><source 
src="http://example.com/images/0/00/Video.ogv"; type="video/ogg; 
codecs=&quot;theora&quot;" data-title="Original Ogg file, 320 × 240 (590 kbps)" 
data-shorttitle="Ogg source" data-width="320" data-height="240" 
data-bandwidth="590013" data-framerate="30"/></video></div>
 
+!! html/parsoid
+<p><span class="mw-default-size" typeof="mw:Video" 
data-mw='{"attribs":[["href",{"html":"link=Example"}]]}'><span><video 
controls="" preload="none" height="240" width="320" 
resource="./File:Video.ogv"><source 
src="http://example.com/images/0/00/Video.ogv"; type="application/ogg" 
data-file-width="320" data-file-height="240"/></video></span></span></p>
 !! end
 
 !! test
 Video with different thumb image
 !! wikitext
-[[File:Video.ogv|thumb=Foobar.jpg]]
-!! html
+[[File:Video.ogv|thumbnail=Foobar.jpg]]
+!! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:1943px;"><a 
href="/wiki/File:Video.ogv"><img alt="Video.ogv" 
src="http://example.com/images/3/3a/Foobar.jpg"; width="1941" height="220" 
class="thumbimage" /></a>  <div class="thumbcaption"><div class="magnify"><a 
href="/wiki/File:Video.ogv" class="internal" 
title="Enlarge"></a></div></div></div></div>
 
+!! html/parsoid
+<figure class="mw-default-size" typeof="mw:Video/Thumb" 
data-mw='{"thumb":"Foobar.jpg"}'><span><video 
poster="//example.com/images/3/3a/Foobar.jpg" controls="" preload="none" 
height="240" width="320" resource="./File:Video.ogv"><source 
src="http://example.com/images/0/00/Video.ogv"; type="application/ogg" 
data-file-width="320" data-file-height="240"/></video></span></figure>
 !! end
 
 !! test
 Simple audio element
 !! wikitext
 [[File:Audio.oga]]
-!! html
+!! html/php
 <div class="mediaContainer" style="width:180px"><audio id="mwe_player_1" 
controls="" preload="none" style="width:180px" class="kskin" 
data-durationhint="0.99875" data-startoffset="0" data-mwtitle="Audio.oga" 
data-mwprovider="local"><source src="http://example.com/images/4/41/Audio.oga"; 
type="audio/ogg; codecs=&quot;vorbis&quot;" data-title="Original Ogg file (41 
kbps)" data-shorttitle="Ogg source" data-width="0" data-height="0" 
data-bandwidth="41107"/></audio></div>
 
-!! html+tidy
+!! html/php+tidy
 <div class="mediaContainer" style="width:180px"><audio id="mwe_player_1" 
controls="" preload="none" style="width:180px" class="kskin" 
data-durationhint="0.99875" data-startoffset="0" data-mwtitle="Audio.oga" 
data-mwprovider="local">
 <source src="http://example.com/images/4/41/Audio.oga"; type="audio/ogg; 
codecs=&quot;vorbis&quot;" data-title="Original Ogg file (41 kbps)" 
data-shorttitle="Ogg source" data-width="0" data-height="0" 
data-bandwidth="41107" /></audio></div>
-!!end
+!! html/parsoid
+<p><span class="mw-default-size" typeof="mw:Audio"><span><video controls="" 
preload="none" resource="./File:Audio.oga"><source 
src="http://example.com/images/4/41/Audio.oga"; 
type="application/ogg"/></video></span></span></p>
+!! end
+
+!! test
+Flag noplayer, noicon, and disablecontrols as bogus options
+!! wikitext
+[[File:Video.ogv|noplayer|noicon|disablecontrols=ok|These are bogus.]]
+!! html/parsoid
+<p><span class="mw-default-size" typeof="mw:Video" 
data-parsoid='{"optList":[{"ck":"bogus","ak":"noplayer"},{"ck":"bogus","ak":"noicon"},{"ck":"bogus","ak":"disablecontrols=ok"},{"ck":"caption","ak":"These
 are bogus."}]}' data-mw='{"caption":"These are bogus."}'><span><video 
controls="" preload="none" height="240" width="320" 
resource="./File:Video.ogv"><source 
src="http://example.com/images/0/00/Video.ogv"; type="application/ogg" 
data-file-width="320" data-file-height="240"/></video></span></span></p>
+!! end

-- 
To view, visit https://gerrit.wikimedia.org/r/349719
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1efbb82fe8f72f8de611b855d9ebb59786cb5449
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: Arlolra <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to